-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH: Add a np.isnan loop for the object dtype (and possible isfinite
, ...)
#9009
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'd draw the line at 4. I think it would be very reasonable to have:
|
No, that is what I mean |
To be fair, it wasn't clear whether the ellipses in 1. & 2. would include things such as strings, lists, maps, etc. But in any case, then I guess 3 is a good cut-off. |
Would this enhancement allow numpy.isnan(numpy.array([],dtype=object))) to not fail? |
@eric-wieser is this still relevant? |
Yes, I think so. I think #6320 contains a candidate implementation. |
isfinite
, ...)
People are bending themselves out of shape to do this.
because testing for nan's (at least in principle) doesn't have anything to do with having to cast. Even more so because adding |
Uh oh!
There was an error while loading. Please reload this page.
This would fix help fix #9008.
From most to least-well defined
float
,np.float32
,np.datetime64
... →return np.isnan(item)
int
,np.int32
, ... →return False
__float__
or__int__
- returnnp.isnan(float(x))
np.ndarray
→return np.isnan(item)
(requires aO->O
loop, notO->?
)return x != x
I think I'd draw the line after 3, and have 4 onwards throw an error.
The text was updated successfully, but these errors were encountered: