xarray.groupers.SeasonGrouper#
- class xarray.groupers.SeasonGrouper(seasons)[source]#
Allows grouping using a custom definition of seasons.
- Parameters:
seasons (sequence of
str
) – List of strings representing seasons. E.g."JF"
or"JJA"
etc. Overlapping seasons are allowed (e.g.["DJFM", "MAMJ", "JJAS", "SOND"]
)
Examples
>>> SeasonGrouper(["JF", "MAM", "JJAS", "OND"]) SeasonGrouper(seasons=['JF', 'MAM', 'JJAS', 'OND'])
The ordering is preserved
>>> SeasonGrouper(["MAM", "JJAS", "OND", "JF"]) SeasonGrouper(seasons=['MAM', 'JJAS', 'OND', 'JF'])
Overlapping seasons are allowed
>>> SeasonGrouper(["DJFM", "MAMJ", "JJAS", "SOND"]) SeasonGrouper(seasons=['DJFM', 'MAMJ', 'JJAS', 'SOND'])
Methods
__init__
(seasons)factorize
(group)Creates intermediates necessary for GroupBy.
reset
()Creates a new version of this Grouper clearing any caches.
Attributes
seasons