xarray.core.resample.DataArrayResample#

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

DataArrayGroupBy object specialized to time resampling operations.

The resampling is done over a specified dimension.

__init__(*args, dim=None, resample_dim=None, **kwargs)[source]#

Create a GroupBy object.

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

  • groupers (tuple of ResolvedGrouper) – The resolved groupers to group by.

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

Methods

__init__(*args[, dim, resample_dim])

Create a GroupBy object.

all([dim, keep_attrs])

Reduce this DataArray's data by applying all along some dimension(s).

any([dim, keep_attrs])

Reduce this DataArray's data by applying any along some dimension(s).

apply(func[, args, shortcut])

Backward compatible implementation of map.

asfreq()

Return values of original object at the new up-sampling frequency.

assign_coords([coords])

Assign coordinates by group.

backfill([tolerance])

Backward fill new values at up-sampled frequency.

bfill([tolerance])

Backward fill new values at up-sampled frequency.

count([dim, keep_attrs])

Reduce this DataArray's data by applying count along some dimension(s).

cumprod([dim, skipna, keep_attrs])

Reduce this DataArray's data by applying cumprod (i.e., cumulative product) along some dimension(s).

cumsum([dim, skipna, keep_attrs])

Reduce this DataArray's data by applying cumsum (i.e., cumulative sum) along some dimension(s).

ffill([tolerance])

Forward fill new values at up-sampled frequency.

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.

interpolate([kind])

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

last([skipna, keep_attrs])

Return the last element of each group along the group dimension.

map(func[, args, shortcut])

Apply a function to each array in the group and concatenate the results.

max([dim, skipna, keep_attrs])

Reduce this DataArray's data by applying max (i.e., maximum) along some dimension(s).

mean([dim, skipna, keep_attrs])

Reduce this DataArray's data by applying mean along some dimension(s).

median([dim, skipna, keep_attrs])

Reduce this DataArray's data by applying median along some dimension(s).

min([dim, skipna, keep_attrs])

Reduce this DataArray's data by applying min (i.e., minimum) along some dimension(s).

nearest([tolerance])

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

pad([tolerance])

Forward fill new values at up-sampled frequency.

prod([dim, skipna, min_count, keep_attrs])

Reduce this DataArray's data by applying prod (i.e., product) along some dimension(s).

quantile(q[, dim, method, keep_attrs, skipna])

Compute the qth quantile over each array in the groups.

reduce(func[, dim, axis, keep_attrs, shortcut])

Reduce the items in this group by applying func along the resampling dim.

shuffle_to_chunks([chunks])

Sort or "shuffle" the underlying object.

std([dim, skipna, ddof, keep_attrs])

Reduce this DataArray's data by applying std (i.e., standard deviation) along some dimension(s).

sum([dim, skipna, min_count, keep_attrs])

Reduce this DataArray's data by applying sum along some dimension(s).

var([dim, skipna, ddof, keep_attrs])

Reduce this DataArray's data by applying var (i.e., variance) along some dimension(s).

where(cond[, other])

Return elements from self or other depending on cond.

Attributes

dims

encoded

group1d

groupers

groups

Mapping from group labels to indices.

sizes

Ordered mapping from dimension names to lengths.