# xarray.core.groupby.DatasetGroupBy¶

class xarray.core.groupby.DatasetGroupBy(obj, group, squeeze=False, grouper=None, bins=None, restore_coord_dims=True, cut_kwargs=None)
__init__(obj, group, squeeze=False, grouper=None, bins=None, restore_coord_dims=True, cut_kwargs=None)

Create a GroupBy object

Parameters

Methods

 __init__(obj, group[, squeeze, grouper, …]) Create a GroupBy object all([dim]) Reduce this DatasetGroupBy’s data by applying all along some dimension(s). any([dim]) Reduce this DatasetGroupBy’s data by applying any along some dimension(s). apply(func[, args, shortcut]) Backward compatible implementation of map assign(**kwargs) Assign data variables by group. assign_coords([coords]) Assign coordinates by group. count([dim]) Reduce this DatasetGroupBy’s data by applying count along some dimension(s). fillna(value) Fill missing values in this object by group. first([skipna, keep_attrs]) Return the first element of each group along the group dimension last([skipna, keep_attrs]) Return the last element of each group along the group dimension map(func[, args, shortcut]) Apply a function to each Dataset in the group and concatenate them together into a new Dataset. max([dim, skipna]) Reduce this DatasetGroupBy’s data by applying max along some dimension(s). mean([dim, skipna]) Reduce this DatasetGroupBy’s data by applying mean along some dimension(s). median([dim, skipna]) Reduce this DatasetGroupBy’s data by applying median along some dimension(s). min([dim, skipna]) Reduce this DatasetGroupBy’s data by applying min along some dimension(s). prod([dim, skipna]) Reduce this DatasetGroupBy’s data by applying prod along some dimension(s). quantile(q[, dim, interpolation, …]) Compute the qth quantile over each array in the groups and concatenate them together into a new array. reduce(func[, dim, keep_attrs]) Reduce the items in this group by applying func along some dimension(s). std([dim, skipna]) Reduce this DatasetGroupBy’s data by applying std along some dimension(s). sum([dim, skipna]) Reduce this DatasetGroupBy’s data by applying sum along some dimension(s). var([dim, skipna]) Reduce this DatasetGroupBy’s data by applying var along some dimension(s). where(cond[, other]) Return elements from self or other depending on cond.

Attributes