8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2a2dc51 + 379ffd4 commit f048051Copy full SHA for f048051
numpy/core/fromnumeric.py
@@ -2086,15 +2086,25 @@ def clip(a, a_min, a_max, out=None, **kwargs):
2086
--------
2087
:ref:`ufuncs-output-type`
2088
2089
+ Notes
2090
+ -----
2091
+ When `a_min` is greater than `a_max`, `clip` returns an
2092
+ array in which all values are equal to `a_max`,
2093
+ as shown in the second example.
2094
+
2095
Examples
2096
2097
>>> a = np.arange(10)
- >>> np.clip(a, 1, 8)
- array([1, 1, 2, 3, 4, 5, 6, 7, 8, 8])
2098
>>> a
2099
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
2100
+ >>> np.clip(a, 1, 8)
2101
+ array([1, 1, 2, 3, 4, 5, 6, 7, 8, 8])
2102
+ >>> np.clip(a, 8, 1)
2103
+ array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
2104
>>> np.clip(a, 3, 6, out=a)
2105
array([3, 3, 3, 3, 4, 5, 6, 6, 6, 6])
2106
+ >>> a
2107
+ array([3, 3, 3, 3, 4, 5, 6, 6, 6, 6])
2108
2109
2110
0 commit comments