-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Support numpy ufuncs for ExtensionArrays #22798
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
Comments
I'm bumping into this for PeriodArray. Previously I'll do this as a separate PR from PeriodArray. |
This seems difficult for older numpys without
At the moment, I think working around these would be too difficult. Right now, I'll see if we can support numpy with |
BTW, I also have some branch adding the basics of this to ExtensionArrary / IntegerArray. And also stumbled on the current implementation with So I would maybe also start with only supporting it for newer numpy. Question: is |
I think just a test asserting that it worked.
…________________________________
From: Joris Van den Bossche <[email protected]>
Sent: Monday, October 1, 2018 5:11:48 PM
To: pandas-dev/pandas
Cc: Tom Augspurger; Comment
Subject: Re: [pandas-dev/pandas] Support numpy ufuncs for ExtensionArrays (#22798)
BTW, I also have some branch adding the basics of this to ExtensionArrary / IntegerArray. And also stumbled on the current implementation with __array__ / __array_prepare__.
So I would maybe also start with only supporting it for newer numpy.
Question: is np.add(Series[period], 2) used somewhere in our code, or in a test?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#22798 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABQHIqQxJjvcj5TqjdAcjgSfm_yFaoaAks5ugpMkgaJpZM4W0Ct2>.
|
This was fixed at the pandas level in #23293. 3rd party arrays just need to implement |
Currently calling numpy ufuncs such as
np.exp
on a Series[EA] or EA does not work yet:I think it would be nice to have this working, and without looking in detail into it, I would assume the best way to go is to actually support the
__array_ufunc__
protocol on ExtensionArrays itself and to ensure Series then properly uses that?The text was updated successfully, but these errors were encountered: