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

API: Have invalid_comparison return pandas object following __pandas_priority__? #54475

Open
mroeschke opened this issue Aug 9, 2023 · 3 comments
Labels
API Design Numeric Operations Arithmetic, Comparison, and Logical operations

Comments

@mroeschke
Copy link
Member

Currently an invalid comparison (eq and ne only) returns an np.ndarray[bool].

In [5]: i = pd.Index([1, 2, 3], dtype='datetime64[ns]')

In [6]: s = pd.Series([1, 2, 3], dtype='timedelta64[ns]')

In [7]: i == s
Out[7]: array([False, False, False])

Should this follow __pandas_priority__ now and return Series[bool]?

@mroeschke mroeschke added API Design Numeric Operations Arithmetic, Comparison, and Logical operations labels Aug 9, 2023
@jbrockmendel
Copy link
Member

xref #36759

@mroeschke
Copy link
Member Author

xref #36759

Thanks. Any thoughts on whether EA == other should return a pandas object?

@jbrockmendel
Copy link
Member

Any thoughts on whether EA == other should return a pandas object?

I'd assume that we would use __pandas_priority__ to determine whether to return NotImplemented. If not returning NotImplemented, I'd expect to return either ndarray[bool] or EA[bool-ish]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

No branches or pull requests

2 participants