# xarray.groupers.SeasonResampler

### *class* xarray.groupers.SeasonResampler(seasons, , drop_incomplete=True)[[source]](https://github.com/pydata/xarray/blob/main/xarray/groupers.py#L881-L1120)

Allows grouping using a custom definition of seasons.

* **Parameters:**
  * **seasons** (`Sequence[str]`) – An ordered list of seasons.
  * **drop_incomplete** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool)) – Whether to drop seasons that are not completely included in the data.
    For example, if a time series starts in Jan-2001, and seasons includes “DJF”
    then observations from Jan-2001, and Feb-2001 are ignored in the grouping
    since Dec-2000 isn’t present.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('157cf53f-bfe5-42dd-be51-08882cd13218','e123d0ee-6208-4f0f-b6e5-1268529ea91d','737730c2-1a02-4d27-b7d0-1e1e737ba502','../lite/tree/../notebooks/index.html?path=927dcf09_d733_46fb_b502_51eb6fe21e13.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> SeasonResampler(["JF", "MAM", "JJAS", "OND"])
SeasonResampler(seasons=['JF', 'MAM', 'JJAS', 'OND'], drop_incomplete=True)
```

```pycon
>>> SeasonResampler(["DJFM", "AM", "JJA", "SON"])
SeasonResampler(seasons=['DJFM', 'AM', 'JJA', 'SON'], drop_incomplete=True)
```

<div id="737730c2-1a02-4d27-b7d0-1e1e737ba502" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('157cf53f-bfe5-42dd-be51-08882cd13218','737730c2-1a02-4d27-b7d0-1e1e737ba502')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('157cf53f-bfe5-42dd-be51-08882cd13218','737730c2-1a02-4d27-b7d0-1e1e737ba502')">Open In Tab</button></div><div id="e123d0ee-6208-4f0f-b6e5-1268529ea91d" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>

#### \_\_init_\_(seasons, , drop_incomplete=True)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../doc/<string>)

### Methods

| [`__init__`](#xarray.groupers.SeasonResampler.__init__)(seasons, \*[, drop_incomplete])                                         |                                                            |
|-----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|
| [`compute_chunks`](xarray.groupers.SeasonResampler.compute_chunks.html.md#xarray.groupers.SeasonResampler.compute_chunks)(variable, \*, dim) | Compute chunk sizes for this season resampler.             |
| `factorize`(group)                                                                                                                | Creates intermediates necessary for GroupBy.               |
| `reset`()                                                                                                                         | Creates a new version of this Grouper clearing any caches. |

### Attributes

| `drop_incomplete`   |    |
|---------------------|----|
| `seasons`           |    |
| `season_inds`       |    |
| `season_tuples`     |    |
