# xarray.Dataset.resample

#### Dataset.resample(indexer=None, , skipna=None, closed=None, label=None, offset=None, origin='start_day', restore_coord_dims=None, \*\*indexer_kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataset.py#L10708-L10787)

Returns a Resample object for performing resampling operations.

Handles both downsampling and upsampling. The resampled
dimension must be a datetime-like coordinate. If any intervals
contain no values from the original object, they will be given
the value `NaN`.

* **Parameters:**
  * **indexer** (`Mapping` of `Hashable` to [`str`](https://docs.python.org/3/builtins/stdtypes.html#str), [`datetime.timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta), `pd.Timedelta`, `pd.DateOffset`, or [`Resampler`](xarray.groupers.Resampler.html.md#xarray.groupers.Resampler), *optional*) – Mapping from the dimension name to resample frequency <sup>[1](#id2)</sup>. The
    dimension must be datetime-like.
  * **skipna** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *optional*) – Whether to skip missing values when aggregating in downsampling.
  * **closed** (`{"left", "right"}`, *optional*) – Side of each interval to treat as closed.
  * **label** (`{"left", "right"}`, *optional*) – Side of each interval to use for labeling.
  * **origin** (`{'epoch', 'start', 'start_day', 'end', 'end_day'}`, `pd.Timestamp`, [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime), `np.datetime64`, or [`cftime.datetime`](https://unidata.github.io/cftime/api.html#cftime.datetime), *default* `'start_day'`) – The datetime on which to adjust the grouping. The timezone of origin
    must match the timezone of the index.

    If a datetime is not used, these values are also supported:
    - ‘epoch’: origin is 1970-01-01
    - ‘start’: origin is the first value of the timeseries
    - ‘start_day’: origin is the first day at midnight of the timeseries
    - ‘end’: origin is the last value of the timeseries
    - ‘end_day’: origin is the ceiling midnight of the last day
  * **offset** (`pd.Timedelta`, [`datetime.timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta), or [`str`](https://docs.python.org/3/builtins/stdtypes.html#str), *default* `is None`) – An offset timedelta added to the origin.
  * **restore_coord_dims** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *optional*) – If True, also restore the dimension order of multi-dimensional
    coordinates.
  * **\*\*indexer_kwargs** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), [`datetime.timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta), `pd.Timedelta`, `pd.DateOffset`, or [`Resampler`](xarray.groupers.Resampler.html.md#xarray.groupers.Resampler)) – The keyword arguments form of `indexer`.
    One of indexer or indexer_kwargs must be provided.
* **Returns:**
  **resampled** ([`core.resample.DataArrayResample`](xarray.core.resample.DataArrayResample.html.md#xarray.core.resample.DataArrayResample)) – This object resampled.

#### SEE ALSO
[`DataArray.resample`](xarray.DataArray.resample.html.md#xarray.DataArray.resample), [`pandas.Series.resample`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.resample.html#pandas.Series.resample), [`pandas.DataFrame.resample`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.resample.html#pandas.DataFrame.resample), [`Dataset.groupby`](xarray.Dataset.groupby.html.md#xarray.Dataset.groupby), [`DataArray.groupby`](xarray.DataArray.groupby.html.md#xarray.DataArray.groupby)

### References

* <a id='id2'>**[1]**</a> [https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases](https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases)
