-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
PERF: faster _coerce_to_data_and_mask() for astype("Float64") #60121
PERF: faster _coerce_to_data_and_mask() for astype("Float64") #60121
Conversation
Failures seem unrelated: |
@rhshadrach friendly ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks a lot @auderson!
elif values.dtype.kind == "f": | ||
# np.isnan is faster than is_numeric_na() for floats | ||
# github issue: #60066 | ||
mask = np.isnan(values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we ever get a masked float values
here with pd.NA
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a
if not copy:
values = np.asarray(values)
else:
values = np.array(values, copy=copy)
above, so values
is guaranteed to be a numpy array at this point
Thanks @auderson |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Use
np.isnan
for floats instead oflibmissing.is_numeric_na
. Also add a fast path for booleansPrev:
New: