(values, axis, keepdims=False)
| 58 | |
| 59 | |
| 60 | def nanlast(values, axis, keepdims=False): |
| 61 | if isinstance(axis, tuple): |
| 62 | (axis,) = axis |
| 63 | axis = normalize_axis_index(axis, values.ndim) |
| 64 | rev = (slice(None),) * axis + (slice(None, None, -1),) |
| 65 | idx_last = -1 - np.argmax(~pd.isnull(values)[rev], axis=axis) |
| 66 | result = _select_along_axis(values, idx_last, axis) |
| 67 | if keepdims: |
| 68 | return np.expand_dims(result, axis=axis) |
| 69 | else: |
| 70 | return result |
| 71 | |
| 72 | |
| 73 | def inverse_permutation(indices: np.ndarray, N: int | None = None) -> np.ndarray: |
nothing calls this directly
no test coverage detected
searching dependent graphs…