-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
unexpected behaviour on full_like(<int_array>, nan) #8017
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
Hmm... IIRC, there are three treatments of nan -> int, the one shown, conversion to 0, and raising an error. We should try to rationalize things at some point. For the current behavior, I agree that raising an error would be better. |
I can't say I really understand how |
The problem with integers as that there aren't any left over, whereas for floating point there are bit patterns not used by any actual floating point number. |
Ah, fair enough. I guess it would take a change in python itself to specify that e.g |
Google "missing values" to see how various (statistical) projects deal with similar needs. Note that missing values are not quite the same as not-a-number. |
This will now at the very least give a RuntimeWarning on There is still a more general issue whether:
At least for the second part, I kept gh-14412 as an issue open. So closing this for now, but please feel free to open a new issue if you feel it is important (and there is no current duplicate; if there is a duplicate just comment there!) |
Normally, conversion of an NaN to an int fails:
I suspect the
full_like
behaviour should similarly raise an error. I'm not sure how common this behaviour is.The text was updated successfully, but these errors were encountered: