cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group