-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Fix stats.scoreatpercentile #3186
Conversation
[0.03, 4.03, 8.03], | ||
[3, 7, 11], | ||
[3, 7, 11]]) | ||
assert_equal(res2, expected2) |
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.
I'm not sure if the _equal
is always guaranteed.
Floating point calculations could still introduce a noise, but maybe not in this case (1. * x + 0. * y == x) ? IIUC
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.
Oops, copying test case without thinking. Will change to assert_allclose
.
looks good to me |
Addresses Josef's review comment.
scoreatpercentile should be implementable in terms of numpy.percentile in numpy 1.9. That supports all the usual numpy features including extended axis. |
@juliantaylor that should be done as soon as numpy 1.9 is the minimum supported version I think. I don't see a reason to now do
|
its significantly faster as it uses partition instead of sort. but it can still wait a while 1.9 isn't even out yet :) |
My general opinion is that we should point users to numpy.percentile as soon as 1.9 is out and tell them it's much faster, and deprecate this function as soon as possible. (I haven't checked whether there could be anything specific "stats" that would make it worth keeping. maybe nan handling or masked arrays?) |
Point out that users should use |
What's wrong with wrapping it with a deprecationwarning as soon as 1.9 is out? (given that DeprecationWarning is off by default with py2.7 anyway) |
We should only generate In this case there's also no hurry, given that |
I don't think we need to add a "This function is dooomed." |
Agreed, will do. |
docstring updated |
Can we merge this one now? |
Thanks, merged. |
Fix ndarray input for
per
parameter and empty input. Closes gh-1897 and gh-2861.