summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-06-10 12:14:45 -0600
committerGitHub <noreply@github.com>2021-06-10 12:14:45 -0600
commitca5f55bbef3613433c19b84bcd83ecf3bea75731 (patch)
treea911ec5f67afa7774388eb68ff6c61edd8098c04 /numpy/core/fromnumeric.py
parentbd3daa61e6580cdfdc2398945df425fef719170d (diff)
parentad3484568b7b7939797948d9a2f6b062b9c1200d (diff)
downloadnumpy-ca5f55bbef3613433c19b84bcd83ecf3bea75731.tar.gz
Merge pull request #19165 from BvB93/searchsorted
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.py13
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
"""