Reduce this Dataset'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,
)
| 4025 | return out |
| 4026 | |
| 4027 | def max( |
| 4028 | self, |
| 4029 | dim: Dims = None, |
| 4030 | *, |
| 4031 | skipna: bool | None = None, |
| 4032 | keep_attrs: bool | None = None, |
| 4033 | **kwargs: Any, |
| 4034 | ) -> Dataset: |
| 4035 | """ |
| 4036 | Reduce this Dataset's data by applying ``max`` along some dimension(s). |
| 4037 | |
| 4038 | Parameters |
| 4039 | ---------- |
| 4040 | dim : str, Iterable of Hashable, "..." or None, default: None |
| 4041 | Name of dimension[s] along which to apply ``max``. For e.g. ``dim="x"`` |
| 4042 | or ``dim=["x", "y"]``. If None, will reduce over the GroupBy dimensions. |
| 4043 | If "...", will reduce over all dimensions. |
| 4044 | skipna : bool or None, optional |
| 4045 | If True, skip missing values (as marked by NaN). By default, only |
| 4046 | skips missing values for float dtypes; other dtypes either do not |
| 4047 | have a sentinel missing value (int) or ``skipna=True`` has not been |
| 4048 | implemented (object, datetime64 or timedelta64). |
| 4049 | keep_attrs : bool or None, optional |
| 4050 | If True, ``attrs`` will be copied from the original |
| 4051 | object to the new one. If False, the new object will be |
| 4052 | returned without attributes. |
| 4053 | **kwargs : Any |
| 4054 | Additional keyword arguments passed on to the appropriate array |
| 4055 | function for calculating ``max`` on this object's data. |
| 4056 | These could include dask-specific kwargs like ``split_every``. |
| 4057 | |
| 4058 | Returns |
| 4059 | ------- |
| 4060 | reduced : Dataset |
| 4061 | New Dataset with ``max`` applied to its data and the |
| 4062 | indicated dimension(s) removed |
| 4063 | |
| 4064 | See Also |
| 4065 | -------- |
| 4066 | numpy.max |
| 4067 | dask.array.max |
| 4068 | Dataset.max |
| 4069 | :ref:`groupby` |
| 4070 | User guide on groupby operations. |
| 4071 | |
| 4072 | Notes |
| 4073 | ----- |
| 4074 | Use the ``flox`` package to significantly speed up groupby computations, |
| 4075 | especially with dask arrays. Xarray will use flox by default if installed. |
| 4076 | Pass flox-specific keyword arguments in ``**kwargs``. |
| 4077 | See the `flox documentation <https://flox.readthedocs.io>`_ for more. |
| 4078 | |
| 4079 | Examples |
| 4080 | -------- |
| 4081 | >>> da = xr.DataArray( |
| 4082 | ... np.array([1, 2, 3, 0, 2, np.nan]), |
| 4083 | ... dims="time", |
| 4084 | ... coords=dict( |
nothing calls this directly
no test coverage detected