MCPcopy Create free account
hub / github.com/numpy/numpy / replace_masked

Function replace_masked

numpy/ma/extras.py:799–807  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

797 low_high = np.take_along_axis(asorted, lh, axis=axis)
798
799 def replace_masked(s):
800 # Replace masked entries with minimum_full_value unless it all values
801 # are masked. This is required as the sort order of values equal or
802 # larger than the fill value is undefined and a valid value placed
803 # elsewhere, e.g. [4, --, inf].
804 if np.ma.is_masked(s):
805 rep = (~np.all(asorted.mask, axis=axis, keepdims=True)) & s.mask
806 s.data[rep] = np.ma.minimum_fill_value(asorted)
807 s.mask[rep] = False
808
809 replace_masked(low_high)
810

Callers 1

_medianFunction · 0.85

Calls 1

allMethod · 0.45

Tested by

no test coverage detected