Closed scottyhq closed 2 weeks ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Exercises now rendered consistently in website and jupyterlab with gated syntax (https://myst-parser.readthedocs.io/en/latest/syntax/admonitions.html)
::::{admonition} Exercise
:class: tip
Calculate the rolling mean in 5 point bins along both latitude and longitude using
[`rolling(...).reduce`](https://docs.xarray.dev/en/stable/generated/xarray.core.rolling.DataArrayRolling.reduce.html)
:::{admonition} Solution
:class: dropdown
```python
# exactly equivalent to data.rolling(...).mean()
data.rolling(lat=5, lon=5, center=True).reduce(np.mean).plot();
::: ::::
<img width="900" alt="image" src="https://github.com/xarray-contrib/xarray-tutorial/assets/3924836/173702f0-b801-4724-b275-4e9f562dfc81">
😠Deploy PR Preview 8dc179be1d55a230536a817d6ed53d08480ad67f failed. Build logs
🤖 By surge-preview
Addresses https://github.com/xarray-contrib/xarray-tutorial/issues/241, https://github.com/xarray-contrib/xarray-tutorial/issues/188, #88
Drops sphinx-exercise which seems unmaintained and not compatible with JupyterBook v1
Replaces #242