8000 BUG: Fixes for ma.median and nanpercentile. by juliantaylor · Pull Request #8372 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Fixes for ma.median and nanpercentile. #8372

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 5 commits into from
Dec 13, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ENH: update the small nanmedian threshold
The apply_along_axis path is significantly more expensive than currently
accounted for in the check. Increase the minimum axis size from 400 to
1000 elements.
Either apply_along_axis got more expensive over time or the original
benchmarking was flawed.
  • Loading branch information
juliantaylor committed Dec 12, 2016
commit 1e3ec9fd3b4261c5222b2383589d170e98b7ecc3
2 changes: 1 addition & 1 deletion numpy/lib/nanfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ def _nanmedian(a, axis=None, out=None, overwrite_input=False):
else:
# for small medians use sort + indexing which is still faster than
# apply_along_axis
if a.shape[axis] < 400:
if a.shape[axis] < 1000:
return _nanmedian_small(a, axis, out, overwrite_input)
result = np.apply_along_axis(_nanmedian1d, axis, a, overwrite_input)
if out is not None:
Expand Down
0