-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
read_hdf throws UnicodeDecodeError with Python 3.5 and 3.6 but not with Python 2.7 #17540
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
@zoof : Thanks for reporting this. Strange that it's in this order and not vice-versa (support for unicode is much better in Python 3.x than in Python 2.x). I see that you are using @jreback : I seem to be recalling a previous issue similar to this. Am I right about that or not? |
Updated to 0.20.3:
|
show what u wrote and how |
Sorry, basically the same as before:
|
you are not answering the question; show an example of WRITING |
I guess you want a sample dataset? I extracted a small sample from the troublesome series in the large HDF file: https://ufile.io/l94bf. This file too works with Python 2.7 but fails with Python 3.x. |
you need to show a complete example that includes writing and reading |
Like this? The data in each instance is the same, just different sources.
|
Use 2.7
Try to read in 3.6
|
This is not supported for fixed stores, try using |
you can also see #11126, and try passing |
read_hdf
throws UnicodeDecodeError with Python 3.5 and 3.6 but not with Python 2.7
The former works but the latter does not. I don't see why this is not a bug though since 2.7 can read the file produced without |
it is simply not supported but the underllhing infrastructure (e.g. in PyTables). |
Just a postscript.
when saving using |
I have the same issue. |
As a workaround I'm currently converting my python2.7 dataframes in JSON and then read them using python3.6.
|
Hi, I met a similar issue. The dataframe was saved in Python 2.7 with |
Code Sample, a copy-pastable example if possible
Problem description
The HDF5 dataset was created with
pandas
,to_hdf
in Python 2.7 and can be read in by Python 2.7. When I try to read it in with Python 3.5 or Python 3.6, I get the following:Note: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!
Note: Many problems can be resolved by simply upgrading
pandas
to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check ifmaster
addresses this issue, but that is not necessary.For documentation-related issues, you can check the latest versions of the docs on
master
here:https://pandas-docs.github.io/pandas-docs-travis/
If the issue has not been resolved there, go ahead and file it in the issue tracker.
Expected Output
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]The text was updated successfully, but these errors were encountered: