@@ -6017,23 +6017,25 @@ def transpose(self, *args):
6017
6017
def clip (self , minval = None , maxval = None , out = None ):
6018
6018
r"""Clip (limit) the values in an array.
6019
6019
6020
- Given an interval, values outside the interval are clipped to the interval edges .
6020
+ Given an interval, values outside the interval are clipped to the interval bounds .
6021
6021
For example, if an interval of [0, 1] is specified, values smaller than 0 become 0,
6022
6022
and values larger than 1 become 1.
6023
6023
6024
6024
Parameters
6025
6025
----------
6026
6026
minval : scalar or array-like, optional
6027
- Minimum value. If None, clipping is not performed on lower interval edge.
6028
- Not more than one of `minval` and `maxval` may be None.
6027
+ Minimum value. If None, clipping is not performed on lower bound.
6029
6028
Defaults to None.
6030
6029
maxval : scalar or array-like, optional
6031
- Maximum value. If None, clipping is not performed on upper interval edge.
6032
- Not more than one of `minval` and `maxval` may be None.
6030
+ Maximum value. If None, clipping is not performed on upper bound.
6033
6031
Defaults to None.
6034
6032
out : LArray, optional
6035
6033
The results will be placed in this array.
6036
6034
6035
+ Notes
6036
+ -----
6037
+ At least either `minval` or `maxval` must be defined.
6038
+
6037
6039
Returns
6038
6040
-------
6039
6041
LArray
@@ -6058,15 +6060,15 @@ def clip(self, minval=None, maxval=None, out=None):
6058
6060
a1 0 1 2
6059
6061
a2 2 2 2
6060
6062
6061
- Clipping on lower interval edge only
6063
+ Clipping on lower bound only
6062
6064
6063
6065
>>> arr.clip(0)
6064
6066
a\b b0 b1 b2
6065
6067
a0 0 0 0
6066
6068
a1 0 1 2
6067
6069
a2 3 4 5
6068
6070
6069
- Clipping on upper interval edge only
6071
+ Clipping on upper bound only
6070
6072
6071
6073
>>> arr.clip(maxval=2)
6072
6074
a\b b0 b1 b2
0 commit comments