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")
| 1571 | |
| 1572 | |
| 1573 | def _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 | |
| 1597 | def _nanquantile_1d(arr1d, q, overwrite_input=False, method="linear"): |
nothing calls this directly
no test coverage detected