Skip to content

Commit 8413b5a

Browse files
bzahseberg
authored andcommitted
MAINT: Clean following PR comments
1 parent 2a5422d commit 8413b5a

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

numpy/lib/function_base.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3915,7 +3915,7 @@ def percentile(a,
39153915
* (H&F 8): 'median_unbiased'
39163916
* (H&F 9): 'normal_unbiased'
39173917
3918-
.. versionadded;: 1.22.0
3918+
.. versionchanged:: 1.22.0
39193919
39203920
keepdims : bool, optional
39213921
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):
44394439
diff_b_a = subtract(b, a)
44404440
# asanyarray is a stop-gap until gh-13105
44414441
lerp_interpolation = asanyarray(add(a, diff_b_a * t, out=out))
4442-
lerp_interpolation = subtract(b,
4443-
diff_b_a * (1 - t),
4444-
out=lerp_interpolation,
4445-
where=t >= 0.5)
4442+
subtract(b, diff_b_a * (1 - t), out=lerp_interpolation, where=t >= 0.5)
44464443
if lerp_interpolation.ndim == 0 and out is None:
44474444
lerp_interpolation = lerp_interpolation[()] # unpack 0d arrays
44484445
return lerp_interpolation
@@ -4580,7 +4577,7 @@ def _quantile(
45804577
except KeyError:
45814578
raise ValueError(
45824579
f"{interpolation!r} is not a valid interpolation. Use one of: "
4583-
f"{_QuantileInterpolation.keys()}")
4580+
f"{_QuantileInterpolation.keys()}") from None
45844581
virtual_indexes = interpolation["get_virtual_index"](values_count,
45854582
quantiles)
45864583
virtual_indexes = np.asanyarray(virtual_indexes)

numpy/lib/nanfunctions.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ def nanquantile(
15321532
* (H&F 8): 'median_unbiased'
15331533
* (H&F 9): 'normal_unbiased'
15341534
1535-
.. versionadded;: 1.22.0
1535+
.. versionchanged:: 1.22.0
15361536
15371537
keepdims : bool, optional
15381538
If this is set to True, the axes which are reduced are left in
@@ -1729,12 +1729,8 @@ def _nanquantile_unchecked(
17291729
return r
17301730

17311731

1732-
def _nanquantile_ureduce_func(a,
1733-
q,
1734-
axis=None,
1735-
out=None,
1736-
overwrite_input=False,
1737-
interpolation= "linear"):
1732+
def _nanquantile_ureduce_func(a, q, axis=None, out=None, overwrite_input=False,
1733+
interpolation="linear"):
17381734
"""
17391735
Private function that doesn't support extended axis or keepdims.
17401736
These methods are extended to this function using _ureduce
@@ -1757,10 +1753,7 @@ def _nanquantile_ureduce_func(a,
17571753
return result
17581754

17591755

1760-
def _nanquantile_1d(arr1d,
1761-
q,
1762-
overwrite_input=False,
1763-
interpolation= "linear"):
1756+
def _nanquantile_1d(arr1d, q, overwrite_input=False, interpolation="linear"):
17641757
"""
17651758
Private function for rank 1 arrays. Compute quantile ignoring NaNs.
17661759
See nanpercentile for parameter usage

0 commit comments

Comments
 (0)