diff options
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/function_base.py | 9 | ||||
-rw-r--r-- | numpy/lib/nanfunctions.py | 15 |
2 files changed, 7 insertions, 17 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index a16781f53..c33626df4 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -3915,7 +3915,7 @@ def percentile(a, * (H&F 8): 'median_unbiased' * (H&F 9): 'normal_unbiased' - .. versionadded;: 1.22.0 + .. versionchanged:: 1.22.0 keepdims : bool, optional If this is set to True, the axes which are reduced are left in @@ -4439,10 +4439,7 @@ def _lerp(a, b, t, out=None): diff_b_a = subtract(b, a) # asanyarray is a stop-gap until gh-13105 lerp_interpolation = asanyarray(add(a, diff_b_a * t, out=out)) - lerp_interpolation = subtract(b, - diff_b_a * (1 - t), - out=lerp_interpolation, - where=t >= 0.5) + subtract(b, diff_b_a * (1 - t), out=lerp_interpolation, where=t >= 0.5) if lerp_interpolation.ndim == 0 and out is None: lerp_interpolation = lerp_interpolation[()] # unpack 0d arrays return lerp_interpolation @@ -4580,7 +4577,7 @@ def _quantile( except KeyError: raise ValueError( f"{interpolation!r} is not a valid interpolation. Use one of: " - f"{_QuantileInterpolation.keys()}") + f"{_QuantileInterpolation.keys()}") from None virtual_indexes = interpolation["get_virtual_index"](values_count, quantiles) virtual_indexes = np.asanyarray(virtual_indexes) diff --git a/numpy/lib/nanfunctions.py b/numpy/lib/nanfunctions.py index 710242d59..c3333a83a 100644 --- a/numpy/lib/nanfunctions.py +++ b/numpy/lib/nanfunctions.py @@ -1532,7 +1532,7 @@ def nanquantile( * (H&F 8): 'median_unbiased' * (H&F 9): 'normal_unbiased' - .. versionadded;: 1.22.0 + .. versionchanged:: 1.22.0 keepdims : bool, optional If this is set to True, the axes which are reduced are left in @@ -1729,12 +1729,8 @@ def _nanquantile_unchecked( return r -def _nanquantile_ureduce_func(a, - q, - axis=None, - out=None, - overwrite_input=False, - interpolation= "linear"): +def _nanquantile_ureduce_func(a, q, axis=None, out=None, overwrite_input=False, + interpolation="linear"): """ Private function that doesn't support extended axis or keepdims. These methods are extended to this function using _ureduce @@ -1757,10 +1753,7 @@ def _nanquantile_ureduce_func(a, return result -def _nanquantile_1d(arr1d, - q, - overwrite_input=False, - interpolation= "linear"): +def _nanquantile_1d(arr1d, q, overwrite_input=False, interpolation="linear"): """ Private function for rank 1 arrays. Compute quantile ignoring NaNs. See nanpercentile for parameter usage |