xarray.groupers.TimeResampler (original) (raw)

class xarray.groupers.TimeResampler(freq, closed=None, label=None, origin='start_day', offset=None)[source]#

Grouper object specialized to resampling the time coordinate.

freq#

Frequency to resample to. See Pandas frequency aliasesfor a list of possible values.

Type:

str, datetime.timedelta, pandas.Timestamp, or pandas.DateOffset

closed#

Side of each interval to treat as closed.

Type:

{"left", "right"}, optional

label#

Side of each interval to use for labeling.

Type:

{"left", "right"}, optional

origin#

The datetime on which to adjust the grouping. The timezone of origin must match the timezone of the index.

If a datetime is not used, these values are also supported: - ‘epoch’: origin is 1970-01-01 - ‘start’: origin is the first value of the timeseries - ‘start_day’: origin is the first day at midnight of the timeseries - ‘end’: origin is the last value of the timeseries - ‘end_day’: origin is the ceiling midnight of the last day

Type:

{'epoch', 'start', 'start_day', 'end', 'end_day'}, pandas.Timestamp, datetime.datetime, numpy.datetime64, or cftime.datetime, default 'start_day'

offset#

An offset timedelta added to the origin.

Type:

pd.Timedelta, datetime.timedelta, or str, default is None

__init__(freq, closed=None, label=None, origin='start_day', offset=None)[source]#

Methods

Attributes