xarray.core.resample.DataArrayResample

class xarray.core.resample.DataArrayResample(*args, dim=None, resample_dim=None, **kwargs)

DataArrayGroupBy object specialized to time resampling operations over a specified dimension

__init__(self, *args, dim=None, resample_dim=None, **kwargs)

Create a GroupBy object

Parameters
  • obj (Dataset or DataArray) – Object to group.

  • group (DataArray) – Array with the group values.

  • squeeze (boolean, optional) – If “group” is a coordinate of object, squeeze controls whether the subarrays have a dimension of length 1 along that coordinate or if the dimension is squeezed out.

  • grouper (pd.Grouper, optional) – Used for grouping values along the group array.

  • bins (array-like, optional) – If bins is specified, the groups will be discretized into the specified bins by pandas.cut.

  • restore_coord_dims (bool, optional) – If True, also restore the dimension order of multi-dimensional coordinates.

  • cut_kwargs (dict, optional) – Extra keyword arguments to pass to pandas.cut

Methods

__init__(self, \*args[, dim, resample_dim])

Create a GroupBy object

all(self[, dim, axis])

Reduce this DataArrayResample’s data by applying all along some dimension(s).

any(self[, dim, axis])

Reduce this DataArrayResample’s data by applying any along some dimension(s).

apply(self, func[, shortcut, args])

Apply a function over each array in the group and concatenate them together into a new array.

argmax(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying argmax along some dimension(s).

argmin(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying argmin along some dimension(s).

asfreq(self)

Return values of original object at the new up-sampling frequency; essentially a re-index with new times set to NaN.

assign_coords(self[, coords])

Assign coordinates by group.

backfill(self[, tolerance])

Backward fill new values at up-sampled frequency.

bfill(self[, tolerance])

Backward fill new values at up-sampled frequency.

count(self[, dim, axis])

Reduce this DataArrayResample’s data by applying count along some dimension(s).

ffill(self[, tolerance])

Forward fill new values at up-sampled frequency.

fillna(self, value)

Fill missing values in this object by group.

first(self[, skipna, keep_attrs])

Return the first element of each group along the group dimension

interpolate(self[, kind])

Interpolate up-sampled data using the original data as knots.

last(self[, skipna, keep_attrs])

Return the last element of each group along the group dimension

max(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying max along some dimension(s).

mean(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying mean along some dimension(s).

median(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying median along some dimension(s).

min(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying min along some dimension(s).

nearest(self[, tolerance])

Take new values from nearest original coordinate to up-sampled frequency coordinates.

pad(self[, tolerance])

Forward fill new values at up-sampled frequency.

prod(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying prod along some dimension(s).

quantile(self, q[, dim, interpolation, …])

Compute the qth quantile over each array in the groups and concatenate them together into a new array.

reduce(self, func[, dim, axis, keep_attrs, …])

Reduce the items in this group by applying func along some dimension(s).

std(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying std along some dimension(s).

sum(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying sum along some dimension(s).

var(self[, dim, axis, skipna])

Reduce this DataArrayResample’s data by applying var along some dimension(s).

where(self, cond[, other])

Return elements from self or other depending on cond.

Attributes

dims

groups