READ_CSV
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)
Example
Having problems with this example app? Join our Discord community and we will help you out!
In this example, READ_CSV
loads a local csv file of the and TABLE
shows the corresponding .csv file into dataframe.