Skip to content

BUG: TimedeltaIndex == integer raises TypeError #23063

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

Closed
jbrockmendel opened this issue Oct 9, 2018 · 2 comments · Fixed by #24056
Closed

BUG: TimedeltaIndex == integer raises TypeError #23063

jbrockmendel opened this issue Oct 9, 2018 · 2 comments · Fixed by #24056
Labels
API Design Dtype Conversions Unexpected or buggy dtype conversions Error Reporting Incorrect or improved errors from pandas
Milestone

Comments

@jbrockmendel
Copy link
Member

pd.TimedeltaIndex(['1D']) == 1
[...]
TypeError: cannot compare a TimedeltaIndex with type int

pd.TimedeltaIndex(['1D']) == 1.
[...]
TypeError: cannot compare a TimedeltaIndex with type float
@mroeschke
Copy link
Member

Is the expected behavior to coerce the numeric to seconds/nanoseconds and compare?

@jbrockmendel
Copy link
Member Author

For equality checks it should come back as not-equal. Inequality checks should raise TypeError.

@sinhrks sinhrks added Dtype Conversions Unexpected or buggy dtype conversions API Design labels Oct 10, 2018
@jreback jreback added the Error Reporting Incorrect or improved errors from pandas label Dec 3, 2018
@jreback jreback added this to the 0.24.0 milestone Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Dtype Conversions Unexpected or buggy dtype conversions Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants