def _nanmedian_small(a, axis=None, out=None, overwrite_input=False):
a = np.ma.masked_array(a, np.isnan(a))<EOL>m = np.ma.median(a, axis=axis, overwrite_input=overwrite_input)<EOL>for i in range(np.count_nonzero(m.mask.ravel())):<EOL><INDENT>warnings.warn("<STR_LIT>", RuntimeWarning)<EOL><DEDENT>if out is not None:<EOL><INDENT>out[...] = m.filled(np.nan)<EOL>return out<EOL><DEDENT>return m.filled(np.nan)<EOL>
sort + indexing median, faster for small medians along multiple dimensions
due to the high overhead of apply_along_axis
see nanmedian for parameter usage