diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2021-06-03 23:17:21 +0200 |
---|---|---|
committer | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2021-06-03 23:17:21 +0200 |
commit | ad3484568b7b7939797948d9a2f6b062b9c1200d (patch) | |
tree | 4c2389d12d9d0804687528618201a14f89704673 /numpy/core/fromnumeric.py | |
parent | 6790873334b143117f4e8d1f515def8c7fdeb9fb (diff) | |
download | numpy-ad3484568b7b7939797948d9a2f6b062b9c1200d.tar.gz |
DOC: Explicitly mention that `searchsorted` returns an integer if `v` is a scalar
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 13 |
1 files changed, 7 insertions, 6 deletions
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 """ |