to_csv - allow to create folders. (original) (raw)
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 raiseIOError: [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