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

Function _nanquantile_ureduce_func

numpy/lib/nanfunctions.py:1573–1594  ·  view source on GitHub ↗

Private function that doesn't support extended axis or keepdims. These methods are extended to this function using _ureduce See nanpercentile for parameter usage

(a, q, axis=None, out=None, overwrite_input=False,
                              method="linear")

Source from the content-addressed store, hash-verified

1571
1572
1573def _nanquantile_ureduce_func(a, q, axis=None, out=None, overwrite_input=False,
1574 method="linear"):
1575 """
1576 Private function that doesn't support extended axis or keepdims.
1577 These methods are extended to this function using _ureduce
1578 See nanpercentile for parameter usage
1579 """
1580 if axis is None or a.ndim == 1:
1581 part = a.ravel()
1582 result = _nanquantile_1d(part, q, overwrite_input, method)
1583 else:
1584 result = np.apply_along_axis(_nanquantile_1d, axis, a, q,
1585 overwrite_input, method)
1586 # apply_along_axis fills in collapsed axis with results.
1587 # Move that axis to the beginning to match percentile's
1588 # convention.
1589 if q.ndim != 0:
1590 result = np.moveaxis(result, axis, 0)
1591
1592 if out is not None:
1593 out[...] = result
1594 return result
1595
1596
1597def _nanquantile_1d(arr1d, q, overwrite_input=False, method="linear"):

Callers

nothing calls this directly

Calls 2

_nanquantile_1dFunction · 0.85
ravelMethod · 0.45

Tested by

no test coverage detected