Skip to content

to_hdf broken for timezone aware datetime64[ns] columns in pandas 0.17.0 #11710

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

Closed
nickos556 opened this issue Nov 27, 2015 · 1 comment
Closed
Labels
IO HDF5 read_hdf, HDFStore

Comments

@nickos556
Copy link

Saving DataFrame's to HDF format is broken for the new timezone aware datetime64[ns] datatype.
See the following example:

import pandas as pd
import numpy as np
from datetime import datetime

print "pandas version", pd.__version__

df1 = pd.DataFrame(data=np.random.randn(5,3), index=pd.DatetimeIndex(start=datetime.now(),freq='S',periods=5))
df1 = df1.reset_index() #Create a column of type datetime64[ns] (timezone naiive)
print df1.info()
df1.to_hdf('df.hdf', 'data_frame') #WORKS!!!

df2 = pd.DataFrame(data=np.random.randn(5,3), index=pd.DatetimeIndex(start=datetime.now(),freq='S',periods=5, tz='Australia/Sydney'))
df2 = df2.reset_index() #Create a column of type datetime64[ns, Australia/Sydney] (timezone AWARE)
print df2.info()
df2.to_hdf('df.hdf', 'data_frame') #BREAKS IN pandas 17.0!!!
@jreback
Copy link
Contributor

jreback commented Nov 27, 2015

fixed by #11628

and in 0.17.1

@jreback jreback closed this as completed Nov 27, 2015
@jreback jreback added the IO HDF5 read_hdf, HDFStore label Nov 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO HDF5 read_hdf, HDFStore
Projects
None yet
Development

No branches or pull requests

2 participants