Skip to content

can't obtain items from DatetimeIndex'ed DataFrame #7209

Closed
@yarikoptic

Description

@yarikoptic

found that my numpy-vbench setup was not working for a while due to need for fresh cython... upgraded cython. Now I am trying to render pages where I got code hitting #4547 but even rebuilding pandas current master ( v0.14.0rc1-51-gccd593f) using cython 0.19.2+git5-g0c6fdf0-1~nd70+1 resulted in the same failure, so I decided to change my code but got stuck with inability to reference entries in the DataFrame using its own index items:

This session is with prev release:

(Pdb) print pandas.__version__
0.13.1
(Pdb) print means[means.index[0]]  # works for this one
0.000877753633415
(Pdb) print results[results.index[0]] # but doesn't for another one with the same index
*** KeyError: u'no item named 2011-03-13 11:39:17'
(Pdb) print np.all(results.index == means.index)
True
(Pdb) print results.index
<class 'pandas.tseries.index.DatetimeIndex'>
[2011-03-13 11:39:17, ..., 2014-05-19 13:35:52]
Length: 1735, Freq: None, Timezone: None
(Pdb) print results
                    revision ncalls    timing traceback
timestamp
2011-03-13 11:39:17  c3f4e89  43690  0.000868      None
2011-03-14 00:44:47  c5c3cb9  43690  0.000855      None
(Pdb) print (results.index == results.index[0])[:2] # clearly item is there
[ True False]

in current master it was similar:

(Pdb) print pandas.__version__
0.14.0rc1-51-gccd593f
(Pdb) print (results.index == results.index[0])[:2] # clearly item is there
[ True False]
(Pdb) print results[results.index[0]]
*** KeyError: Timestamp('2011-03-13 11:39:17')

am I doing something stupid or there is a bug somewhere? didn't look into how those timestamps stored in the sqlite DB and brought back -- may be loading/unpickling? them back somehow causes this behavior... just awkward

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions