8000 BUG: handle unmasked NaN in ma.median like normal median by juliantaylor · Pull Request #8364 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: handle unmasked NaN in ma.median like normal median #8364

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 3 commits into from
Dec 12, 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
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 3b31fa130959bbc5544e7b5fa5226076466d6d88
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