Skip to content
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

BUG: Fix median and quantile NaT handling #23774

Merged
merged 1 commit into from May 19, 2023
Merged

Conversation

seberg
Copy link
Member

@seberg seberg commented May 17, 2023

Note that this doesn't mean that rounding is correct at least for quantiles, so there is some dubious about it being a good idea to use this.

But, it does fix the issue, and I the copyto solution seems rather good to me, the only thing that isn't ideal is the supports_nan definition itself.

Closes gh-20376


I don't trust quantiles on times, because I don't trust the time * float multiplication really (and probably more).

But, maybe it's still OK to fix the NaT handling to make some sense... The fix tries to be minimal, but I feel the DATA_AXIS = 0 and take doesn't help.

Note that this doesn't mean that rounding is correct at least for
quantiles, so there is some dubious about it being a good idea to
use this.

But, it does fix the issue, and I the `copyto` solution seems rather
good to me, the only thing that isn't ideal is the `supports_nan`
definition itself.

Closes numpygh-20376
@seberg seberg added this to the 1.25.0 release milestone May 17, 2023
@charris charris merged commit bce6492 into numpy:main May 19, 2023
58 checks passed
@charris
Copy link
Member

charris commented May 19, 2023

Thanks Sebastian.

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label May 19, 2023
@charris
Copy link
Member

charris commented May 19, 2023

I marked this for backport although that might be risky.

@seberg
Copy link
Member Author

seberg commented May 20, 2023

Hmmm, this bug has been around very long, lets just punt on backporting?

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label May 20, 2023
@charris
Copy link
Member

charris commented May 20, 2023

You convinced me :)

@seberg seberg deleted the nat-median branch May 20, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: NaT handling change 1.21.2 -> 1.21.3 triggering issue in np.median
2 participants