max(a, axis=None, keepdims=False, split_every=None, out=None)
This docstring was copied from numpy.max.
Some inconsistencies with the Dask version may exist.
NaN values are propagated, that is if at least one item is NaN, the corresponding max value will be NaN as well. To ignore NaN values (MATLAB behavior), please use nanmax.
Don't use :None:None:`amax`
for element-wise comparison of 2 arrays; when a.shape[0]
is 2, maximum(a[0], a[1])
is faster than amax(a, axis=0)
.
Input data.
Axis or axes along which to operate. By default, flattened input is used.
If this is a tuple of ints, the maximum is selected over multiple axes, instead of a single axis or all the axes as before.
Alternative output array in which to place the result. Must be of the same shape and buffer length as the expected output. See ufuncs-output-type
for more details.
If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.
If the default value is passed, then keepdims
will not be passed through to the :None:None:`amax`
method of sub-classes of :None:None:`ndarray`
, however any non-default value will be. If the sub-class' method does not implement keepdims
any exceptions will be raised.
The minimum value of an output element. Must be present to allow computation on empty slice. See :None:None:`~numpy.ufunc.reduce`
for details.
Elements to compare for the maximum. See :None:None:`~numpy.ufunc.reduce`
for details.
Maximum of a
. If :None:None:`axis`
is None, the result is a scalar value. If :None:None:`axis`
is given, the result is an array of dimension a.ndim - 1
.
Return the maximum of an array or maximum along an axis.
amin
The minimum value of an array along a given axis, propagating any NaNs.
argmax
Return the indices of the maximum values.
fmax
Element-wise maximum of two arrays, ignoring any NaNs.
maximum
Element-wise maximum of two arrays, propagating any NaNs.
nanmax
The maximum value of an array along a given axis, ignoring any NaNs.
>>> a = np.arange(4).reshape((2,2)) # doctest: +SKIPThis example is valid syntax, but we were not able to check execution
... a # doctest: +SKIP array([[0, 1], [2, 3]])
>>> np.amax(a) # Maximum of the flattened array # doctest: +SKIP 3This example is valid syntax, but we were not able to check execution
>>> np.amax(a, axis=0) # Maxima along the first axis # doctest: +SKIP array([2, 3])This example is valid syntax, but we were not able to check execution
>>> np.amax(a, axis=1) # Maxima along the second axis # doctest: +SKIP array([1, 3])This example is valid syntax, but we were not able to check execution
>>> np.amax(a, where=[False, True], initial=-1, axis=0) # doctest: +SKIP array([-1, 3])This example is valid syntax, but we were not able to check execution
>>> b = np.arange(5, dtype=float) # doctest: +SKIPThis example is valid syntax, but we were not able to check execution
... b[2] = np.NaN # doctest: +SKIP
... np.amax(b) # doctest: +SKIP nan
>>> np.amax(b, where=~np.isnan(b), initial=-1) # doctest: +SKIP 4.0This example is valid syntax, but we were not able to check execution
>>> np.nanmax(b) # doctest: +SKIP 4.0
You can use an initial value to compute the maximum of an empty slice, or to initialize it to a different value:
This example is valid syntax, but we were not able to check execution>>> np.amax([[-50], [10]], axis=-1, initial=0) # doctest: +SKIP array([ 0, 10])
Notice that the initial value is used as one of the elements for which the maximum is determined, unlike for the default argument Python's max function, which is only used for empty iterables.
This example is valid syntax, but we were not able to check execution>>> np.amax([5], initial=6) # doctest: +SKIP 6This example is valid syntax, but we were not able to check execution
>>> max([5], default=6) # doctest: +SKIP 5See :
The following pages refer to to this document either explicitly or contain code examples using this.
dask.array.reductions.nanmax
dask.array.reductions.max
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them