From 3b31fa130959bbc5544e7b5fa5226076466d6d88 Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Mon, 12 Dec 2016 23:15:21 +0100 Subject: 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. --- numpy/lib/nanfunctions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/nanfunctions.py') diff --git a/numpy/lib/nanfunctions.py b/numpy/lib/nanfunctions.py index c024055ba..08358a030 100644 --- a/numpy/lib/nanfunctions.py +++ b/numpy/lib/nanfunctions.py @@ -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: -- cgit v1.2.1