Skip to content
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

saving Panel with PeriodIndex to HDF in table format loses Period information #8224

Closed
andreas-h opened this issue Sep 9, 2014 · 2 comments
Labels
Duplicate Report Duplicate issue or pull request IO HDF5 read_hdf, HDFStore Period Period data type

Comments

@andreas-h
Copy link
Contributor

(Pdb) print pd.__version__
0.14.0-403-ge131df1
(Pdb) print data
<class 'pandas.core.panel.Panel'>
Dimensions: 2 (items) x 35 (major_axis) x 21 (minor_axis)
Items axis: Constant Prices to Current Prices
Major_axis axis: Andaman & Nicobar to West Bengal
Minor_axis axis: 1994 to 2014
(Pdb) print data.minor_axis
<class 'pandas.tseries.period.PeriodIndex'>
[1994, ..., 2014]
Length: 21, Freq: A-MAR
(Pdb) data.to_hdf("test.h5", "test_no_table")
(Pdb) data.to_hdf("test.h5", "test_table", format="table")
(Pdb) pd.read_hdf("test.h5", "/test_no_table").minor_axis
<class 'pandas.tseries.period.PeriodIndex'>
[1994, ..., 2014]
Length: 21, Freq: A-MAR
(Pdb) pd.read_hdf("test.h5", "/test_table").minor_axis
Int64Index([35, 36, 37, 38, 39, 40, 41, 42, 43, 44], dtype='int64')
@jreback
Copy link
Contributor

jreback commented Sep 9, 2014

dupe of #7796

thanks for the report. patches are welcome!

@jreback jreback closed this as completed Sep 9, 2014
@jreback jreback added IO HDF5 read_hdf, HDFStore Period Period data type labels Sep 9, 2014
@jreback
Copy link
Contributor

jreback commented Sep 9, 2014

sorry #7796

@jreback jreback added the Duplicate Report Duplicate issue or pull request label Sep 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request IO HDF5 read_hdf, HDFStore Period Period data type
Projects
None yet
Development

No branches or pull requests

2 participants