Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to the resample docs #3400

Merged
merged 7 commits into from
Oct 16, 2019
12 changes: 8 additions & 4 deletions xarray/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,13 +914,16 @@ def resample(
):
"""Returns a Resample object for performing resampling operations.

Handles both downsampling and upsampling. If any intervals contain no
values from the original object, they will be given the value ``NaN``.
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 : {dim: freq}, optional
Mapping from the dimension name to resample frequency.
Mapping from the dimension name to resample frequency. The
dimension must be datetime-like.
skipna : bool, optional
Whether to skip missing values when aggregating in downsampling.
closed : 'left' or 'right', optional
Expand Down Expand Up @@ -978,6 +981,7 @@ def resample(
* time (time) datetime64[ns] 1999-12-15 1999-12-16 1999-12-17 ...

Limit scope of upsampling method

>>> da.resample(time='1D').nearest(tolerance='1D')
<xarray.DataArray (time: 337)>
array([ 0., 0., nan, ..., nan, 11., 11.])
Expand All @@ -987,7 +991,7 @@ def resample(
References
----------

.. [1] http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases
.. [1] https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
"""
# TODO support non-string indexer after removing the old API.

Expand Down