# xarray.NamedArray.max

#### NamedArray.max(dim=None, , skipna=None, \*\*kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/namedarray/_aggregations.py#L188-L252)

Reduce this NamedArray’s data by applying `max` (i.e., maximum) along some dimension(s).

* **Parameters:**
  * **dim** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), `Iterable` of `Hashable`, `"..."` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *default*: [`None`](https://docs.python.org/3/builtins/constants.html#None)) – Name of dimension[s] along which to apply `max`. For e.g. `dim="x"`
    or `dim=["x", "y"]`. If “…” or None, will reduce over all dimensions.
  * **skipna** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – If True, skip missing values (as marked by NaN). By default, only
    skips missing values for float dtypes; other dtypes either do not
    have a sentinel missing value (int) or `skipna=True` has not been
    implemented (object, datetime64 or timedelta64).
  * **\*\*kwargs** (`Any`) – Additional keyword arguments passed on to the appropriate array
    function for calculating `max` on this object’s data.
    These could include dask-specific kwargs like `split_every`.
* **Returns:**
  **reduced** (`NamedArray`) – New NamedArray with `max` applied to its data and the
  indicated dimension(s) removed

#### SEE ALSO
[`numpy.max`](https://numpy.org/doc/stable/reference/generated/numpy.max.html#numpy.max), [`dask.array.max`](https://docs.dask.org/en/latest/generated/dask.array.max.html#dask.array.max), [`Dataset.max`](xarray.Dataset.max.html.md#xarray.Dataset.max), [`DataArray.max`](xarray.DataArray.max.html.md#xarray.DataArray.max)

[Aggregation](../user-guide/computation.html.md#agg)
: User guide on reduction or aggregation operations.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('502963f6-04e0-4c12-bf94-9022342e52d7','b53b9986-8d80-4ea8-b69a-e0e2b43185a9','a69b86d6-1cab-4d84-b15a-257cc7739ba3','../lite/tree/../notebooks/index.html?path=970afa54_7944_4ec6_b5ae_99eb2a50bf37.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> from xarray.namedarray.core import NamedArray
>>> na = NamedArray("x", np.array([1, 2, 3, 0, 2, np.nan]))
>>> na
<xarray.NamedArray (x: 6)> Size: 48B
array([ 1.,  2.,  3.,  0.,  2., nan])
```

```pycon
>>> na.max()
<xarray.NamedArray ()> Size: 8B
array(3.)
```

Use `skipna` to control whether NaNs are ignored.

```pycon
>>> na.max(skipna=False)
<xarray.NamedArray ()> Size: 8B
array(nan)
```

<div id="a69b86d6-1cab-4d84-b15a-257cc7739ba3" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('502963f6-04e0-4c12-bf94-9022342e52d7','a69b86d6-1cab-4d84-b15a-257cc7739ba3')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('502963f6-04e0-4c12-bf94-9022342e52d7','a69b86d6-1cab-4d84-b15a-257cc7739ba3')">Open In Tab</button></div><div id="b53b9986-8d80-4ea8-b69a-e0e2b43185a9" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
