From ad3484568b7b7939797948d9a2f6b062b9c1200d Mon Sep 17 00:00:00 2001 From: Bas van Beek <43369155+BvB93@users.noreply.github.com> Date: Thu, 3 Jun 2021 23:17:21 +0200 Subject: DOC: Explicitly mention that `searchsorted` returns an integer if `v` is a scalar --- numpy/core/fromnumeric.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'numpy/core/fromnumeric.py') diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 65a42eb1e..820d6831f 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -1318,8 +1318,9 @@ def searchsorted(a, v, side='left', sorter=None): Returns ------- - indices : array of ints - Array of insertion points with the same shape as `v`. + indices : int or array of ints + Array of insertion points with the same shape as `v`, + or an integer if `v` is a scalar. See Also -------- @@ -2088,9 +2089,9 @@ def clip(a, a_min, a_max, out=None, **kwargs): Notes ----- - When `a_min` is greater than `a_max`, `clip` returns an - array in which all values are equal to `a_max`, - as shown in the second example. + When `a_min` is greater than `a_max`, `clip` returns an + array in which all values are equal to `a_max`, + as shown in the second example. Examples -------- @@ -2525,7 +2526,7 @@ def cumsum(a, axis=None, dtype=None, out=None): >>> b = np.array([1, 2e-9, 3e-9] * 1000000) >>> b.cumsum()[-1] 1000000.0050045159 - >>> b.sum() + >>> b.sum() 1000000.0050000029 """ -- cgit v1.2.1