-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REGR: fillna on f32 column raising for f64 #43455
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
Changes from 2 commits
c76953c
d95c157
319992a
10ed55a
a8c0610
d439764
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2208,10 +2208,11 @@ def can_hold_element(arr: ArrayLike, element: Any) -> bool: | |
|
||
elif dtype.kind == "f": | ||
if tipo is not None: | ||
# TODO: itemsize check? | ||
if tipo.kind not in ["f", "i", "u"]: | ||
# Anything other than float/integer we cannot hold | ||
return False | ||
elif dtype.itemsize < tipo.itemsize: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should the itemsize only be compared if dtype.kind and tipo.kind are the same? i.e. tipo.kind is also 'f'. How is the itemsize of an int or uint relevant? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for bringing this up. I think it ultimately comes down to -> if But I think the itemsize check is not sufficient here, because |
||
return False | ||
elif not isinstance(tipo, np.dtype): | ||
# i.e. nullable IntegerDtype or FloatingDtype; | ||
# we can put this into an ndarray losslessly iff it has no NAs | ||
|
Uh oh!
There was an error while loading. Please reload this page.