MCPcopy
hub / github.com/pydata/xarray / rolling

Method rolling

xarray/core/dataset.py:10358–10397  ·  view source on GitHub ↗

Rolling window object for Datasets. Parameters ---------- dim : dict, optional Mapping from the dimension name to create the rolling iterator along (e.g. `time`) to its moving window size. min_periods : int or None, default: None

(
        self,
        dim: Mapping[Any, int] | None = None,
        min_periods: int | None = None,
        center: bool | Mapping[Any, bool] = False,
        **window_kwargs: int,
    )

Source from the content-addressed store, hash-verified

10356 return DatasetWeighted(self, weights)
10357
10358 def rolling(
10359 self,
10360 dim: Mapping[Any, int] | None = None,
10361 min_periods: int | None = None,
10362 center: bool | Mapping[Any, bool] = False,
10363 **window_kwargs: int,
10364 ) -> DatasetRolling:
10365 """
10366 Rolling window object for Datasets.
10367
10368 Parameters
10369 ----------
10370 dim : dict, optional
10371 Mapping from the dimension name to create the rolling iterator
10372 along (e.g. `time`) to its moving window size.
10373 min_periods : int or None, default: None
10374 Minimum number of observations in window required to have a value
10375 (otherwise result is NA). The default, None, is equivalent to
10376 setting min_periods equal to the size of the window.
10377 center : bool or Mapping to int, default: False
10378 Set the labels at the center of the window. The default, False,
10379 sets the labels at the right edge of the window.
10380 **window_kwargs : optional
10381 The keyword arguments form of ``dim``.
10382 One of dim or window_kwargs must be provided.
10383
10384 Returns
10385 -------
10386 computation.rolling.DatasetRolling
10387
10388 See Also
10389 --------
10390 Dataset.cumulative
10391 DataArray.rolling
10392 DataArray.rolling_exp
10393 """
10394 from xarray.computation.rolling import DatasetRolling
10395
10396 dim = either_dict_or_kwargs(dim, window_kwargs, "rolling")
10397 return DatasetRolling(self, dim, min_periods=min_periods, center=center)
10398
10399 def cumulative(
10400 self,

Callers 15

time_rollingMethod · 0.45
time_rolling_longMethod · 0.45
time_rolling_npMethod · 0.45

Calls 2

either_dict_or_kwargsFunction · 0.90
DatasetRollingClass · 0.90

Tested by 15

arraysFunction · 0.36
test_rollingMethod · 0.36
test_cumulativeFunction · 0.36
test_rolling_iterMethod · 0.36
test_rolling_reprMethod · 0.36
test_rolling_docMethod · 0.36