Skip to content

BUG: PeriodIndex comparisons break on listlike #21793

Closed
@jbrockmendel

Description

@jbrockmendel
idx = pd.period_range('2016', periods=3, freq='M')

>>> idx == idx.values
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/pandas/core/indexes/period.py", line 107, in wrapper
    other = Period(other, freq=self.freq)
  File "pandas/_libs/tslibs/period.pyx", line 1777, in pandas._libs.tslibs.period.Period.__new__
TypeError: unhashable type: 'numpy.ndarray'

Metadata

Metadata

Assignees

Labels

IndexRelated to the Index class or subclassesNeeds TestsUnit test(s) needed to prevent regressionsPeriodPeriod data typegood first issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions