xarray.core.resample.DatasetResample
xarray.core.resample.DatasetResample#
- class xarray.core.resample.DatasetResample(*args, dim=None, resample_dim=None, **kwargs)[source]#
DatasetGroupBy object specialized to resampling a specified dimension
- __init__(*args, dim=None, resample_dim=None, **kwargs)[source]#
Create a GroupBy object
- Parameters
group (
Hashable,DataArrayorIndex) – Array with the group values or name of the variable.squeeze (
bool, default:False) – 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 (
pandas.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, default:True) – If True, also restore the dimension order of multi-dimensional coordinates.cut_kwargs (dict-like, optional) – Extra keyword arguments to pass to pandas.cut
Methods
__init__(*args[, dim, resample_dim])Create a GroupBy object
all([dim, keep_attrs])Reduce this Dataset's data by applying
allalong some dimension(s).any([dim, keep_attrs])Reduce this Dataset's data by applying
anyalong some dimension(s).apply(func[, args, shortcut])Backward compatible implementation of
mapasfreq()Return values of original object at the new up-sampling frequency; essentially a re-index with new times set to NaN.
assign(**kwargs)Assign data variables by group.
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 Dataset's data by applying
countalong some dimension(s).cumprod([dim, skipna, keep_attrs])Reduce this Dataset's data by applying
cumprodalong some dimension(s).cumsum([dim, skipna, keep_attrs])Reduce this Dataset's data by applying
cumsumalong 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 over each Dataset in the groups generated for resampling and concatenate them together into a new Dataset.
max([dim, skipna, keep_attrs])Reduce this Dataset's data by applying
maxalong some dimension(s).mean([dim, skipna, keep_attrs])Reduce this Dataset's data by applying
meanalong some dimension(s).median([dim, skipna, keep_attrs])Reduce this Dataset's data by applying
medianalong some dimension(s).min([dim, skipna, keep_attrs])Reduce this Dataset's data by applying
minalong some dimension(s).nearest([tolerance])Take new values from nearest original coordinate to up-sampled frequency coordinates.
pad([tolerance])Forward fill new values at up-sampled frequency.
prod([dim, skipna, min_count, keep_attrs])Reduce this Dataset's data by applying
prodalong some dimension(s).quantile(q[, dim, method, keep_attrs, ...])Compute the qth quantile over each array in the groups and concatenate them together into a new array.
reduce(func[, dim, axis, keep_attrs, ...])Reduce the items in this group by applying func along the pre-defined resampling dimension.
std([dim, skipna, ddof, keep_attrs])Reduce this Dataset's data by applying
stdalong some dimension(s).sum([dim, skipna, min_count, keep_attrs])Reduce this Dataset's data by applying
sumalong some dimension(s).var([dim, skipna, ddof, keep_attrs])Reduce this Dataset's data by applying
varalong some dimension(s).where(cond[, other])Return elements from self or other depending on cond.
Attributes
Mapping from group labels to indices.
sizesOrdered mapping from dimension names to lengths.