Skip to content

BUG: indexing with an entire period_index raising #4125

Closed
@jreback

Description

@jreback
In [57]: pi = pd.period_range('2002-01','2003-12',freq='M')

In [58]: pi
Out[58]: 
<class 'pandas.tseries.period.PeriodIndex'>
freq: M
[2002-01, ..., 2003-12]
length: 24

In [59]: p = pd.Panel(randn(24,5,10),items=pi)

In [60]: p
Out[60]: 
<class 'pandas.core.panel.Panel'>
Dimensions: 24 (items) x 5 (major_axis) x 10 (minor_axis)
Items axis: 2002-01 to 2003-12
Major_axis axis: 0 to 4
Minor_axis axis: 0 to 9

This is ok

In [61]: p.ix[list(pi)]
Out[61]: 
<class 'pandas.core.panel.Panel'>
Dimensions: 24 (items) x 5 (major_axis) x 10 (minor_axis)
Items axis: 2002-01 to 2003-12
Major_axis axis: 0 to 4
Minor_axis axis: 0 to 9

This raises?

In [62]: p.ix[pi]
DateParseError: day is out of range for month

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselvesPeriodPeriod data type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions