Skip to content

ENH: Get rid of float cast in masked reduction ops #50833

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

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Jan 18, 2023

Shouldn't be user visible

@phofl phofl added Enhancement NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Jan 18, 2023
@mroeschke mroeschke added this to the 2.0 milestone Jan 19, 2023
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, the nanops functions will still cast the values to float though as they all call?

    if not is_float_dtype(values.dtype):
        ...

@phofl
Copy link
Member Author

phofl commented Jan 19, 2023

Yep, but this might allow optimisations later on. Also, this fixes a couple of mask related bugs in the nan... functions

@mroeschke mroeschke merged commit ca41a75 into pandas-dev:main Jan 19, 2023
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the masked_float_cast branch January 19, 2023 20:41
pooja-subramaniam pushed a commit to pooja-subramaniam/pandas that referenced this pull request Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PERF: avoid casting to float in IntegerArray reducing ops
2 participants