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

BUG: tz in index not working in HDFStore with table #4098

Closed
jreback opened this issue Jul 1, 2013 · 0 comments · Fixed by #4099
Closed

BUG: tz in index not working in HDFStore with table #4098

jreback opened this issue Jul 1, 2013 · 0 comments · Fixed by #4099
Labels
Bug IO Data IO issues that don't fit into a more specific label
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Jul 1, 2013

In [1]: df = DataFrame(dict(A = Series(xrange(3), index=date_range('2000-1-1',periods=3,freq='H', tz='US/Eastern'))))

In [2]: df.index
Out[2]: 
<class 'pandas.tseries.index.DatetimeIndex'>
[2000-01-01 00:00:00, ..., 2000-01-01 02:00:00]
Length: 3, Freq: H, Timezone: US/Eastern

In [3]: df.to_hdf('tz.h5','df',mode='w')

In [4]: pd.read_hdf('tz.h5','df').index
Out[4]: 
<class 'pandas.tseries.index.DatetimeIndex'>
[2000-01-01 00:00:00, ..., 2000-01-01 02:00:00]
Length: 3, Freq: H, Timezone: US/Eastern

In [5]: df.to_hdf('tz.h5','df',mode='w',table=True)

In [6]: pd.read_hdf('tz.h5','df').index
Out[6]: 
<class 'pandas.tseries.index.DatetimeIndex'>
[2000-01-01 00:00:00, ..., 2000-01-01 02:00:00]
Length: 3, Freq: H, Timezone: US/Eastern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant