-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
HDFStore('file.ext') can't load HDF5 stores created by pytables #1985
Comments
Hello, I have the same issue. I created a PyTable using Pandas to store a Dataframe and a Panel. After closing the file, I reopen it using tables to store metadata in the file by creating a new node (named 'description') in the root. If I want to read the pytable using HDFStore, I must specify the pandas object to retrieve (i.e., the name of the Dataframe or Panel that I stored) otherwise I get the following error: AttributeError: Attribute 'pandas_type' does not exist in node: '/description' I agree with enjoyaol. The HDF5 support is very nice with pandas, but we should be able to access more functionalities from PyTables. It would also be nice to add metadata to the pytables generated with Pandas, or directly to the Pandas Dataframes/Panels. For now I'm doing it manually, but it is not really an efficient way as we get an attribute error. Regards, Greg |
@jreback, would appreciate your opinion. |
I'm not sure what's desired here. The point of |
I read it as a question about HDF as a data source for pandas: like xls or csv. |
I think this is a bit more complicated than roundtripping to xls/csv formats because those have really well defined APIs for their storage formats. Pytables itself is well defined, but pandas implementation of various types is fairly complicated and type dependent (csv is pretty straightforward but of course has many variants that make parse ability hard, xls has the excel front end) that said one COULD externally create a file that HDFStore can read natively - creating a series or DataFrame format is not that hard actually - I could write up a short bit If that is of interest I don't how many people will really want to do it this way - if u already have it stored in pytables, then just read it into memory and put it in a frame and save it back as a store so my vote is provide a simple API (and/or doc the current frame API) On Dec 12, 2012, at 9:58 AM, y-p notifications@github.com wrote:
|
I agree a simple API for reading |
also a clarvoyant request to serialize metadata to HDFS |
done c0003cb so I save the attribute 'meta' if its there, on the roundtrip only populate if its not None of course since its not-propogated by anything right now then you have to add it right before you save in HDFStore
|
@enjoyaol or @leroygr can you provide a sample of the pytables data structure you wish to store? |
@enjoyaol or @leroygr any comments on this? |
Hi all, Sorry for my late answer. I used @jreback method and it fits my needs! Thanks for this. Greg |
this is fixed in GH #2675 |
Hello,
A store created outside of pandas can't be loaded into pandas with the HFDStore() method.
An error occurs : AttributeError: Attribute 'pandas_type' does not exist in node: '/'
To reproduce, create a store using pytables, and try to load it in pandas. It will raise this error.
In my opinion, if pandas is supposed to suppord HDF5, it should do so, without only supporting stores created in pandas. If nothing can be done, can you tell me what is is attribute so that I can create it when I create my store with pytables ?
Thanks !
The text was updated successfully, but these errors were encountered: