-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
to_csv - allow to create folders. #24306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
this is out of scope for pandas itself as it can easily be accomplished by the user |
In this case, |
@JivanRoquet i agree with you, pandas has been known for being beginner friendly, and a simple SO search can guarantee that making directories for output files is a very common issue for python users, particularly analysts that know how to use pandas, but dont really now about filesystems. On the other side, the last pandas community survey indicated that feature creep is an important issue for the community. @jreback maybe makes sense to add a comment with instructions to the docstring of the |
Is possible to make folder drive from colab: |
A note in the docs might be useful, pull requests welcome |
Quoting from #42255 (review)
Do we want this? I'd be happy to make a PR, should be straightforward with
After that, maybe we can consider this too? |
would take this as an enhancement PR.
we would need a new keyword to do this (to preserver backward compabitility), but -1 on adding new keywords so unlikely |
currently
to_csv
will create a file if it does not exist. However it will not create a folder (nor sub-folders).In this case it will raise
IOError: [Errno 2] No such file or directory:
The user must wrap his code in order for it to create a folder.
I'm not sure why the function behaves like this.. It would be great if it will also create folders if needed.
Reference from stack overflow:
https://stackoverflow.com/questions/47143836/pandas-dataframe-to-csv-raising-ioerror-no-such-file-or-directory
The text was updated successfully, but these errors were encountered: