Issue
Reads in a dataset using pandas.
Parameters
----------
file_path : string containing path to a file
Returns
-------
Pandas DataFrame with data read in from the file path
'''
I have defined the following UDF but it doesnt work.
def read_data(file_path): pandas.read_csv('file_path')
Solution
Looks like you are missing the return and the variable shouldn't have quotes
import pandas as pd
def read_data(file_path: str) -> pd.DataFrame:
return pd.read_csv(file_path)
Answered By - Jason Baker
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.