Skip to content

READ_CSV

The READ_CSV node reads a .csv file from disk or a URL, and then returns a dataframe.Params:file_path : strFile path to the .csv file or an URL of a .csv file.Returns:out : DataFrameDataFrame loaded from .csv file
Python Code
from flojoy import flojoy, DataFrame
import pandas as pd


@flojoy
def READ_CSV(
    file_path: str = "https://raw.githubusercontent.com/cs109/2014_data/master/countries.csv",
) -> DataFrame:
    """The READ_CSV node reads a .csv file from disk or a URL, and then returns a dataframe.

    Parameters
    ----------
    file_path : str
        File path to the .csv file or an URL of a .csv file.

    Returns
    -------
    DataFrame
        DataFrame loaded from .csv file
    """

    df = pd.read_csv(file_path)  # type: ignore
    return DataFrame(df=df)

Find this Flojoy Block on GitHub

Example

Having problem with this example app? Join our Discord community and we will help you out!
React Flow mini map

In this example, READ_CSV loads a local csv file of the and TABLE shows the corresponding .csv file into dataframe.