Skip to content

READ_CSV

Download Flojoy Studio to try this app
Read a .csv file from disk or a URL, and then return it as a dataframe. Params: file_path : str File path to the .csv file or an URL of a .csv file. Returns: out : DataFrame DataFrame 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:
    """Read a .csv file from disk or a URL, and then return it as 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 App

Having problems 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.