# 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('d2f9a91b-816f-4445-9f36-271e60497a1d','34591c26-f58d-4147-9fb4-e8ec0f0c77f3','946fd614-4a30-42df-893e-e2b183205f5d','../lite/tree/../notebooks/index.html?path=027bec2b_16fe_4a8a_860f_7385c8837b3d.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="946fd614-4a30-42df-893e-e2b183205f5d" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('d2f9a91b-816f-4445-9f36-271e60497a1d','946fd614-4a30-42df-893e-e2b183205f5d')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('d2f9a91b-816f-4445-9f36-271e60497a1d','946fd614-4a30-42df-893e-e2b183205f5d')">Open In Tab</button></div><div id="34591c26-f58d-4147-9fb4-e8ec0f0c77f3" 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`     |    |
