-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
HDF5 files not compatible between python 2 and 3 ? #4260
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
You can find files here:
|
try storing as here's an example of using 3.3 reading a 2.7 file (storing as a table)::
|
I find out half the issue :-) When I load an h5 file from python 3 created by python 2, string type problems can happen because python 3 and python 2 does not use the same string type. So h5 file keeps current string type. By adding |
hmmm good to know about py2.....let me see if I can reproduce that fyi...here's py3 reading your py2 files....seems ok to me
|
reading in python 2.7.3 works ok as well
|
fyi...your first error seems unrelated to reading anything and here's my 2c....you said you are transitioning from 2 to 3...great.....I would just do a switch and not try to interoperate with the data files, this can be very tricky (as you can see).. maybe you can structure such that writing is only done with say 2.7 for shared files, while reads can be done with both versions |
Can you try: pd.HDFStore('simu_created_by_python_3.h5')['params']
|
Thank you for your advice. Anyway I will try to have something that can interoperate, it shouldn't be so difficult. Now it does not seems to be pandas or pytables issues so thank you for your time and your help ! Bye |
as I said, try using a What you are attempting is non-trivial; maybe best to write out csv's during your transition period |
Ok thank you. I think my code can survive if reading from py3 to py2 does not work :-) |
I have a problem loading a h5 file from python 3 to python 2 and vice versa. I can't post the code which generate h5 file because is part of a big project. I'll try to upload h5 file directly later.
Here is the error when I load FROM python 3.3 an h5 file created BY python 2.7:
Here is the error when I load FROM python 2.7 an h5 file created BY python 3.3:
Version command run:
Python 3 shell:
Python 2 shell:
The text was updated successfully, but these errors were encountered: