Skip to content
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

BUG: PeriodIndex comparisons break on listlike #21793

Closed
jbrockmendel opened this issue Jul 7, 2018 · 1 comment · Fixed by #34175
Closed

BUG: PeriodIndex comparisons break on listlike #21793

jbrockmendel opened this issue Jul 7, 2018 · 1 comment · Fixed by #34175
Assignees
Labels
good first issue Index Related to the Index class or subclasses Needs Tests Unit test(s) needed to prevent regressions Period Period data type
Milestone

Comments

@jbrockmendel
Copy link
Member

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'
@jbrockmendel jbrockmendel added the Period Period data type label Jul 7, 2018
@jbrockmendel jbrockmendel changed the title PeriodIndex comparisons break on listlike BUG: PeriodIndex comparisons break on listlike Oct 12, 2018
@jbrockmendel jbrockmendel self-assigned this Jan 28, 2019
@jbrockmendel jbrockmendel added the Numeric Operations Arithmetic, Comparison, and Logical operations label Dec 11, 2019
@mroeschke
Copy link
Member

This looks to work on master now. Could use a test

In [56]: pd.__version__
Out[56]: '1.1.0.dev0+1536.ga7fb88fd5'

In [57]: idx == idx.values
Out[57]: array([ True,  True,  True])

@mroeschke mroeschke added good first issue Needs Tests Unit test(s) needed to prevent regressions and removed Bug Numeric Operations Arithmetic, Comparison, and Logical operations Period Period data type labels May 11, 2020
jnecus pushed a commit to jnecus/pandas that referenced this issue May 14, 2020
Attempting to implement test for resolved issue pandas-dev#21793
@jreback jreback added this to the 1.1 milestone May 14, 2020
@jreback jreback added Index Related to the Index class or subclasses Period Period data type labels May 14, 2020
jnecus pushed a commit to jnecus/pandas that referenced this issue May 14, 2020
added comment above test for resolved issue pandas-dev#21793
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Index Related to the Index class or subclasses Needs Tests Unit test(s) needed to prevent regressions Period Period data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants