MCPcopy Index your code
hub / github.com/numpy/numpy / _nanmedian1d

Function _nanmedian1d

numpy/lib/_nanfunctions_impl.py:1057–1071  ·  view source on GitHub ↗

Private function for rank 1 arrays. Compute the median ignoring NaNs. See nanmedian for parameter usage

(arr1d, overwrite_input=False)

Source from the content-addressed store, hash-verified

1055
1056
1057def _nanmedian1d(arr1d, overwrite_input=False):
1058 """
1059 Private function for rank 1 arrays. Compute the median ignoring NaNs.
1060 See nanmedian for parameter usage
1061 """
1062 arr1d_parsed, _, overwrite_input = _remove_nan_1d(
1063 arr1d, overwrite_input=overwrite_input,
1064 )
1065
1066 if arr1d_parsed.size == 0:
1067 # Ensure that a nan-esque scalar of the appropriate type (and unit)
1068 # is returned for `timedelta64` and `complexfloating`
1069 return arr1d[-1]
1070
1071 return np.median(arr1d_parsed, overwrite_input=overwrite_input)
1072
1073
1074def _nanmedian(a, axis=None, out=None, overwrite_input=False):

Callers 1

_nanmedianFunction · 0.85

Calls 1

_remove_nan_1dFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…