-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Feature request: write and read dtypes in csv #19378
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
Really I think your best bet is using a storage format that knows types, like HDF5 or parquet - anything on top of CSV is going to be inherently adhoc - not to mention the performance benefits. |
If you need a human-readable format with type descriptions, the newer json schema stuff would also be worth a look; |
Agreed with @chris-b1, you might also look at http://csvy.org/ if you're unable to avoid CSVs. In general, while pandas should be able to read all kinds of messy CSV formats, I don't think we should write invalid CSVs, which your example does with the "comment". |
Thanks @TomAugspurger @chris-b1. Definitely better solutions to my needs. |
So here's something I would like. As an avid pandas user, I'd like to be able to write and read csv's to and from a dataframe including the dtypes of each column.
Reading up on pandas, I thought this does the trick in the most Pythonic way:
Is this something which is worth including, or is it not generic enough and should I just hack my own extension on the Dataframe class?
The text was updated successfully, but these errors were encountered: