NumPy | max method
Start your free 7-days trial now!
Numpy's max(~)
method computes the maximum value of the input array along the specified axis. This is just an alias for Numpy's amax(~)
, so check out the full docs here.
Parameters
1. a
| array_like
The input array.
2. axis
| None
or int
| optional
The allowed values are as follows:
Parameter value | Meaning |
---|---|
axis=0 | Maximum computed column-wise |
axis=1 | Maximum computed row-wise |
None | Maximum computed from entire array |
By default, axis=None
.
3. initial
| int
| optional
If the computed maximum is less than initial
, then initial
will be returned instead.
4. where
| array-like
of booleans
| optional
Instead of considering all the values, we can choose which values to consider by providing this parameter. Only values corresponding to True
in the mask will be considered.
Examples
Refer to amax(~)