You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -81,7 +76,7 @@ attribute like ``'days since 2000-01-01'``).
81
76
82
77
83
78
You can manual decode arrays in this form by passing a dataset to
84
-
:py:func:`~xarray.decode_cf`:
79
+
:py:func:`decode_cf`:
85
80
86
81
.. ipython:: python
87
82
@@ -93,8 +88,8 @@ You can manual decode arrays in this form by passing a dataset to
93
88
coder = xr.coders.CFDatetimeCoder(time_unit="s")
94
89
xr.decode_cf(ds, decode_times=coder)
95
90
96
-
From xarray 2025.01.2 the resolution of the dates can be one of ``"s"``, ``"ms"``, ``"us"`` or ``"ns"``. One limitation of using ``datetime64[ns]`` is that it limits the native representation of dates to those that fall between the years 1678 and 2262, which gets increased significantly with lower resolutions. When a store contains dates outside of these bounds (or dates < `1582-10-15`_ with a Gregorian, also known as standard, calendar), dates will be returned as arrays of :py:class:`cftime.datetime` objects and a :py:class:`~xarray.CFTimeIndex` will be used for indexing.
97
-
:py:class:`~xarray.CFTimeIndex` enables most of the indexing functionality of a :py:class:`pandas.DatetimeIndex`.
91
+
From xarray 2025.01.2 the resolution of the dates can be one of ``"s"``, ``"ms"``, ``"us"`` or ``"ns"``. One limitation of using ``datetime64[ns]`` is that it limits the native representation of dates to those that fall between the years 1678 and 2262, which gets increased significantly with lower resolutions. When a store contains dates outside of these bounds (or dates < `1582-10-15`_ with a Gregorian, also known as standard, calendar), dates will be returned as arrays of :py:class:`cftime.datetime` objects and a :py:class:`CFTimeIndex` will be used for indexing.
92
+
:py:class:`CFTimeIndex` enables most of the indexing functionality of a :py:class:`pandas.DatetimeIndex`.
98
93
See :ref:`CFTimeIndex` for more information.
99
94
100
95
Datetime indexing
@@ -205,35 +200,37 @@ You can also search for multiple months (in this case January through March), us
205
200
Resampling and grouped operations
206
201
---------------------------------
207
202
208
-
Datetime components couple particularly well with grouped operations (see
209
-
:ref:`groupby`) for analyzing features that repeat over time. Here's how to
210
-
calculate the mean by time of day:
203
+
204
+
.. seealso::
205
+
206
+
For more generic documentation on grouping, see :ref:`groupby`.
207
+
208
+
209
+
Datetime components couple particularly well with grouped operations for analyzing features that repeat over time.
210
+
Here's how to calculate the mean by time of day:
211
211
212
212
.. ipython:: python
213
-
:okwarning:
214
213
215
214
ds.groupby("time.hour").mean()
216
215
217
216
For upsampling or downsampling temporal resolutions, xarray offers a
218
-
:py:meth:`~xarray.Dataset.resample` method building on the core functionality
217
+
:py:meth:`Dataset.resample` method building on the core functionality
219
218
offered by the pandas method of the same name. Resample uses essentially the
220
-
same api as ``resample`` `in pandas`_.
219
+
same api as :py:meth:`pandas.DataFrame.resample` `in pandas`_.
0 commit comments