MCPcopy Create free account
hub / github.com/pydata/xarray / max

Method max

xarray/core/_aggregations.py:7094–7198  ·  view source on GitHub ↗

Reduce this DataArray's data by applying ``max`` along some dimension(s). Parameters ---------- dim : str, Iterable of Hashable, "..." or None, default: None Name of dimension[s] along which to apply ``max``. For e.g. ``dim="x"`` or ``dim=["x

(
        self,
        dim: Dims = None,
        *,
        skipna: bool | None = None,
        keep_attrs: bool | None = None,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

7092 return out
7093
7094 def max(
7095 self,
7096 dim: Dims = None,
7097 *,
7098 skipna: bool | None = None,
7099 keep_attrs: bool | None = None,
7100 **kwargs: Any,
7101 ) -> DataArray:
7102 """
7103 Reduce this DataArray's data by applying ``max`` along some dimension(s).
7104
7105 Parameters
7106 ----------
7107 dim : str, Iterable of Hashable, "..." or None, default: None
7108 Name of dimension[s] along which to apply ``max``. For e.g. ``dim="x"``
7109 or ``dim=["x", "y"]``. If None, will reduce over the GroupBy dimensions.
7110 If "...", will reduce over all dimensions.
7111 skipna : bool or None, optional
7112 If True, skip missing values (as marked by NaN). By default, only
7113 skips missing values for float dtypes; other dtypes either do not
7114 have a sentinel missing value (int) or ``skipna=True`` has not been
7115 implemented (object, datetime64 or timedelta64).
7116 keep_attrs : bool or None, optional
7117 If True, ``attrs`` will be copied from the original
7118 object to the new one. If False, the new object will be
7119 returned without attributes.
7120 **kwargs : Any
7121 Additional keyword arguments passed on to the appropriate array
7122 function for calculating ``max`` on this object's data.
7123 These could include dask-specific kwargs like ``split_every``.
7124
7125 Returns
7126 -------
7127 reduced : DataArray
7128 New DataArray with ``max`` applied to its data and the
7129 indicated dimension(s) removed
7130
7131 See Also
7132 --------
7133 numpy.max
7134 dask.array.max
7135 DataArray.max
7136 :ref:`groupby`
7137 User guide on groupby operations.
7138
7139 Notes
7140 -----
7141 Use the ``flox`` package to significantly speed up groupby computations,
7142 especially with dask arrays. Xarray will use flox by default if installed.
7143 Pass flox-specific keyword arguments in ``**kwargs``.
7144 See the `flox documentation <https://flox.readthedocs.io>`_ for more.
7145
7146 Examples
7147 --------
7148 >>> da = xr.DataArray(
7149 ... np.array([1, 2, 3, 0, 2, np.nan]),
7150 ... dims="time",
7151 ... coords=dict(

Callers

nothing calls this directly

Calls 3

_flox_reduceMethod · 0.95
reduceMethod · 0.95

Tested by

no test coverage detected