# xarray.core.resample.DataArrayResample.any

#### DataArrayResample.any(dim=None, , keep_attrs=None, \*\*kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/_aggregations.py#L8492-L8580)

Reduce this DataArray’s data by applying `any` 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 `any`. For e.g. `dim="x"`
    or `dim=["x", "y"]`. If None, will reduce over the Resample dimensions.
    If “…”, will reduce over all dimensions.
  * **keep_attrs** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – If True, `attrs` will be copied from the original
    object to the new one.  If False, the new object will be
    returned without attributes.
  * **\*\*kwargs** (`Any`) – Additional keyword arguments passed on to the appropriate array
    function for calculating `any` on this object’s data.
    These could include dask-specific kwargs like `split_every`.
* **Returns:**
  **reduced** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray)) – New DataArray with `any` applied to its data and the
  indicated dimension(s) removed

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

[Resampling and grouped operations](../user-guide/time-series.html.md#resampling)
: User guide on resampling operations.

### Notes

Use the `flox` package to significantly speed up resampling computations,
especially with dask arrays. Xarray will use flox by default if installed.
Pass flox-specific keyword arguments in `**kwargs`.
See the [flox documentation](https://flox.readthedocs.io) for more.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('e8a49984-8e7a-4f78-a983-045f120e7603','7f47771d-0f09-46dc-abcf-87670e17f8df','1c2eb2d6-d4f0-491c-8ef1-385993b79286','../lite/tree/../notebooks/index.html?path=65476e15_f65f_457e_9798_4bb5291cb94e.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> da = xr.DataArray(
...     np.array([True, True, True, True, True, False], dtype=bool),
...     dims="time",
...     coords=dict(
...         time=("time", pd.date_range("2001-01-01", freq="ME", periods=6)),
...         labels=("time", np.array(["a", "b", "c", "c", "b", "a"])),
...     ),
... )
>>> da
<xarray.DataArray (time: 6)> Size: 6B
array([ True,  True,  True,  True,  True, False])
Coordinates:
  * time     (time) datetime64[us] 48B 2001-01-31 2001-02-28 ... 2001-06-30
    labels   (time) <U1 24B 'a' 'b' 'c' 'c' 'b' 'a'
```

```pycon
>>> da.resample(time="3ME").any()
<xarray.DataArray (time: 3)> Size: 3B
array([ True,  True,  True])
Coordinates:
  * time     (time) datetime64[us] 24B 2001-01-31 2001-04-30 2001-07-31
```

<div id="1c2eb2d6-d4f0-491c-8ef1-385993b79286" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('e8a49984-8e7a-4f78-a983-045f120e7603','1c2eb2d6-d4f0-491c-8ef1-385993b79286')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('e8a49984-8e7a-4f78-a983-045f120e7603','1c2eb2d6-d4f0-491c-8ef1-385993b79286')">Open In Tab</button></div><div id="7f47771d-0f09-46dc-abcf-87670e17f8df" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
