Skip to content

ENH: implement ExtensionArray.__array_ufunc__ #43899

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

Merged
merged 4 commits into from
Oct 6, 2021

Conversation

jbrockmendel
Copy link
Member

This implements ExtensionArray.__array_ufunc__ with minimal behavior changes (xref numpy/numpy#20044 cc @shoyer). The only real behavior change is that np.abs, np.positive, np.negative wrap TimedeltaArray instead of returning ndarray[td64]

After this comes Index.__array_ufunc__

@jreback jreback added Compat pandas objects compatability with Numpy or Python functions ExtensionArray Extending pandas with custom dtypes or arrays. labels Oct 6, 2021
@jreback jreback added this to the 1.4 milestone Oct 6, 2021
@jreback
Copy link
Contributor

jreback commented Oct 6, 2021

The only real behavior change is that np.abs, np.positive, np.negative wrap TimedeltaArray instead of returning ndarray[td64]

thi s is user visible right? if so pls add a whatsnew note, otherwise lgtm.

@jreback jreback merged commit 11f94a5 into pandas-dev:master Oct 6, 2021
@jbrockmendel jbrockmendel deleted the ref-default_array_ufunc-2 branch October 6, 2021 18:36
gasparitiago pushed a commit to gasparitiago/pandas that referenced this pull request Oct 9, 2021
rhshadrach pushed a commit to rhshadrach/pandas that referenced this pull request Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants