Skip to content

BUG: round-trip of tz in an index using fixed-format for HDF5 #8165

Closed
@colbrac

Description

@colbrac

xref #9270

With Python 2.7.6, pandas 0.13.1 and numpy 1.8.1, pytables 3.1.1, both 32 and 64bit (Python x,y and WinPython), I can load my hdf5 file.
With Python 3.4.1 64bit, pandas 0.14.1, numpy 1.8.2, pytables 3.1.1 (Anaconda3 2.0.1) I get the following error:

Traceback (most recent call last):

File "", line 1, in
test = pd.read_hdf('datafile.h5', 'data')

File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 330, in read_hdf
return f(store, True)

File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 322, in
key, auto_close=auto_close, **kwargs)

File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 669, in select
auto_close=auto_close).get_values()

File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 1335, in get_values
results = self.func(self.start, self.stop)

File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 658, in func
columns=columns, **kwargs)

File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 2658, in read
ax = self.read_index('axis%d' % i)

File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 2257, in read_index
_, index = self.read_index_node(getattr(self.group, key))

File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 2385, in read_index_node
_unconvert_index(data, kind, encoding=self.encoding), **kwargs)

File "C:\Anaconda3\lib\site-packages\pandas\core\index.py", line 125, in new
result = DatetimeIndex(data, copy=copy, name=name, **kwargs)

File "C:\Anaconda3\lib\site-packages\pandas\tseries\index.py", line 301, in new
infer_dst=infer_dst)

File "tslib.pyx", line 2165, in pandas.tslib.tz_localize_to_utc (pandas\tslib.c:33574)

File "tslib.pyx", line 2082, in pandas.tslib._get_deltas (pandas\tslib.c:32187)

File "tslib.pyx", line 872, in pandas.tslib._get_utcoffset (pandas\tslib.c:16036)

AttributeError: 'numpy.bytes_' object has no attribute 'utcoffset'

The index in question is:
class 'pandas.tseries.index.DatetimeIndex'
[2013-04-03 00:00:00+02:00, ..., 2013-04-04 00:00:00+02:00]
Length: 8641, Freq: 10S, Timezone: Europe/Amsterdam

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions