Pandas DataFrame error when using to_csv
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 10:40 PM
Hi Everyone,
I would like to a Pandas Dataframe to /dbfs/FileStore/ using to_csv method.
Usually it would just write the Dataframe to the path described but It has been giving me "FileNotFoundError: [Errno 2] No such file or directory: '/dbfs/FileStore/test.csv".
I have tried
df.to_csv("/dbfs/FileStore/test.csv", header= None, index= None)
df.to_csv("dbfs/FileStore/test.csv", header=None, index=None)
df.to_csv("dbfs:/FileStore/test.csv", header=None, index=None)
df.to_csv("/FileStore/test.csv", header=None, index=None)
df.to_csv("FileStore/test.csv", header=None, index=None)
But all give out the same error.
using dbutils i see that the folder are present.
dbutils.fs.ls("dbfs:/FileStore")
Out[32]: [FileInfo(path='dbfs:/FileStore/tables/', name='tables/', size=0, modificationTime=0)]
I am new here and i tried searching the problem for a long time but I can't find a solution. Please help.
Labels:
- Labels:
-
Dataframe
-
Pandas
-
Pandas dataframe
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 12:31 AM
f = open("/dbfs/mnt/blob/myNames.txt", "r")

