cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

pandas.read_csv

MarcoMistroni
New Contributor II

HI all

i have uploaded a file on my cluster , at location

/FileStore/tables/qmwxhxvi1505337108590/PastHires.csv

However, whenever i try to read it using panda

df = pd.read_csv('dbfs:/FileStore/tables/qmwxhxvi1505337108590/PastHires.csv')

, i alwasy get a

File dbfs:/FileStore/tables/qmwxhxvi1505337108590/PastHires.csv does not exist

how can i get around it?

kind regards

4 REPLIES 4

it_live
New Contributor II

Hi, i also struggled to get pandas read from csv. Use the below code with your path with a replacement of dbfs: with /dbfs and remove the header=True to make it works in databricks python notebook. you will end up with: pandas_df = pd.read_csv("/dbfs/FileStore/tables/2esy8tnj1455052720017/part_001-86465.tsv");

FYI reference Databricks Docs :https://docs.databricks.com/user-guide/importing-data.html Original statement not working : pandas_df = pd.read_csv("/dbfs/FileStore/tables/2esy8tnj1455052720017/part_001-86465.tsv", header=True)

Good Luck IT

MarcoMistroni
New Contributor II

Hello

thanks.. that helped

also for some unknown reason my notebook didnt display any output at all and i thought there was something going on withe code

Now i can see my original dataframe. many thanks

kr

rohitshah
New Contributor II

I am also having same issue, I have uploaded file in DBFS and it gives some default code which itself is not working.

Is anyone has solved this issue ?

I'm facing the same issue. However there is a workaround posted here: https://forums.databricks.com/questions/18254/unable-to-read-file-using-pandas.html

Basically read the csv using spark and then convert to pandas

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.