Skip to content

BUG: Added/fixed functionality for infinite and negative infinite values in numpy.quantile(). - #21343

Closed
alajoieumich wants to merge 5 commits into
numpy:mainfrom
alajoieumich:infinite-quantile
Closed

alajoieumich wants to merge 5 commits into
numpy:mainfrom
alajoieumich:infinite-quantile

Conversation

@alajoieumich

Copy link
Copy Markdown

Changes made in numpy/lib/function_base.py and basic tests added in numpy/lib/tests/test_function_base.py. Code is somewhat work in progress- see comments on #21091.

@seberg seberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While I think something like this makes sense, the current code seems much too complicated to me. For one thing also the new path should be vectorized.
One approach may be to see where a == b, and only do the calculation where it is not.

Another thing is that it would be nice if the isinf check could be quick.
I am not actually this matters in practice, since usually, the number of quantiles calculated is much smaller than the number of points in the dataset. But some idea or benchmarking might be nice.

This method is probably the best method if the sample
distribution function is known to be normal.
This method gives continuous results using:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please revert all of the above formatting changes. I am not sure if they are right, but they are also unrelated to anything in this PR.
The same goes for all of the doc changes after your actual changes.

@seberg

seberg commented May 17, 2023

Copy link
Copy Markdown
Member

Closing, needs work and it has been stalled for a year. There is another PR that hits closer to home open also (although also stalled, so picking off from that discussion would be fine).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants