# xarray.computation.rolling.DatasetRolling.construct

#### DatasetRolling.construct(window_dim=None, \*, stride=1, fill_value=<NA>, keep_attrs=None, sliding_window_view_kwargs=None, \*\*window_dim_kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/computation/rolling.py#L1027-L1123)

Convert this rolling object to xr.Dataset,
where the window dimension is stacked as a new dimension

* **Parameters:**
  * **window_dim** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str) or [mapping](https://docs.python.org/3/glossary.html#term-mapping), *optional*) – A mapping from dimension name to the new window dimension names.
    Just a string can be used for 1d-rolling.
  * **stride** ([`int`](https://docs.python.org/3/builtins/functions.html#int), *optional*) – size of stride for the rolling window.
  * **fill_value** (`Any`, *default*: `dtypes.NA`) – Filling value to match the dimension size.
  * **sliding_window_view_kwargs** – Keyword arguments that should be passed to the underlying array type’s
    `sliding_window_view` function.
  * **\*\*window_dim_kwargs** (`{dim: new_name, ...}`, *optional*) – The keyword arguments form of `window_dim`.
* **Returns:**
  [`Dataset`](xarray.Dataset.html.md#xarray.Dataset) – Dataset with views of the original arrays. By default, the returned arrays are not writeable.
  For numpy arrays, one can pass `writeable=True` in `sliding_window_view_kwargs`.

#### SEE ALSO
[`numpy.lib.stride_tricks.sliding_window_view`](https://numpy.org/doc/stable/reference/generated/numpy.lib.stride_tricks.sliding_window_view.html#numpy.lib.stride_tricks.sliding_window_view), [`dask.array.lib.stride_tricks.sliding_window_view`](https://docs.dask.org/en/latest/generated/dask.array.lib.stride_tricks.sliding_window_view.html#dask.array.lib.stride_tricks.sliding_window_view)

### Notes

With dask arrays, it’s possible to pass the `automatic_rechunk` kwarg as
`sliding_window_view_kwargs={"automatic_rechunk": True}`. This controls
whether dask should automatically rechunk the output to avoid
exploding chunk sizes. Automatically rechunking is the default behaviour.
Importantly, each chunk will be a view of the data so large chunk sizes are
only safe if *no* copies are made later.
