# xarray.core.groupby.DatasetGroupBy.all

#### DatasetGroupBy.all(dim=None, , keep_attrs=None, \*\*kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/_aggregations.py#L3801-L3895)

Reduce this Dataset’s data by applying `all` 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 `all`. For e.g. `dim="x"`
    or `dim=["x", "y"]`. If None, will reduce over the GroupBy 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 `all` on this object’s data.
    These could include dask-specific kwargs like `split_every`.
* **Returns:**
  **reduced** ([`Dataset`](xarray.Dataset.html.md#xarray.Dataset)) – New Dataset with `all` applied to its data and the
  indicated dimension(s) removed

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

[GroupBy: Group and Bin Data](../user-guide/groupby.html.md#groupby)
: User guide on groupby operations.

### Notes

Use the `flox` package to significantly speed up groupby 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('62030d18-2eff-414b-b758-01f18cec890b','f92d86a0-83d9-44ea-9e0a-1739511d37b6','164e2dc8-b34a-4a67-bfc1-0f0a32884bd2','../lite/tree/../notebooks/index.html?path=5313a275_43e0_4192_87dc_d842ddfbb230.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"])),
...     ),
... )
>>> ds = xr.Dataset(dict(da=da))
>>> ds
<xarray.Dataset> Size: 78B
Dimensions:  (time: 6)
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'
Data variables:
    da       (time) bool 6B True True True True True False
```

```pycon
>>> ds.groupby("labels").all()
<xarray.Dataset> Size: 27B
Dimensions:  (labels: 3)
Coordinates:
  * labels   (labels) object 24B 'a' 'b' 'c'
Data variables:
    da       (labels) bool 3B False True True
```

<div id="164e2dc8-b34a-4a67-bfc1-0f0a32884bd2" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('62030d18-2eff-414b-b758-01f18cec890b','164e2dc8-b34a-4a67-bfc1-0f0a32884bd2')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('62030d18-2eff-414b-b758-01f18cec890b','164e2dc8-b34a-4a67-bfc1-0f0a32884bd2')">Open In Tab</button></div><div id="f92d86a0-83d9-44ea-9e0a-1739511d37b6" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
