-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: clarify purpose of DataFrame.from_csv (GH4191) #10163
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
DOC: clarify purpose of DataFrame.from_csv (GH4191) #10163
Conversation
I am also not strong on actually deprecating this particular method (as you say its the inverse of |
let's push this off / close. Not sure this is necessary. |
let's just update the docs a tiny bit to note that |
Yes, it was on my to do list to update this PR with only the docs part (and not the actual deprecation). |
which is actually the part from the docstring that I now removed ... :-) |
b68a518
to
11c6ee5
Compare
11c6ee5
to
d4f9325
Compare
@jreback updated it. Thoughts? I still have to do the same for |
lgtm. DISCOURAGED should be an official term! |
lgtm |
d4f9325
to
d2ce36a
Compare
updated with similar text for Series.from_csv |
DOC: clarify purpose of DataFrame.from_csv (GH4191)
Closes #9556
xref #9568, #4916, #4191
However, while writing this up, I started to doubt a bit if this is necessary.
DataFrame.from_csv
is implemented as a round-trip method together withto_csv
. If you use a plaindf.to_csv(path)
, you cannnot read it in aspd.read_csv(path)
to get exactly the same. You at least needpd.read_csv(path, index_col=True)
and aparse_dates
keyword if you have datetimes.Secondly, there is also the question of
Series.from_csv
. It would be logical to deprecate this as well, but for this you don't directly have an alternative (butpd.read_csv(path, index_col=0)[0]
will work). There is also for example this SO answer of Wes: http://stackoverflow.com/questions/13557559/how-to-write-read-pandas-series-to-from-csv (and it is used in the Python for Data Analysis book).