pasteur.extras.transformers.DateTransformer#
- class pasteur.extras.transformers.DateTransformer(span='year', nullable=False, bins=64, max_len=63, **_)[source]#
Attributes
For a given output, the input is the same.
The decoded output equals the input.
Transformer fits variables.
Methods
fit(data[, ref])Fits to the provided data
fit_transform(data[, ref])- rtype:
DataFrame
- rtype:
Mapping[str|tuple[str],Attribute]
get_factory(*args, **kwargs)Returns a factory that registers this module to the system.
iso_to_gregorian(iso_year, iso_week, iso_day)Gregorian calendar date for the given ISO year, week and day
iso_year_start(iso_year)The gregorian calendar date of the first day of the given ISO year
reduce(other)reverse(data[, ref])When reversing, the data column contains encoded data, whereas the ref column contains decoded/original data.
transform(data[, ref])- rtype:
DataFrame
- deterministic = True#
For a given output, the input is the same.
- fit_transform(data, ref=None)#
- Return type:
DataFrame
- classmethod get_factory(*args, **kwargs)#
Returns a factory that registers this module to the system.
Any *args and **kwargs passed to this function will be saved and passed to the module’s __init__() method when calling build().
- static iso_to_gregorian(iso_year, iso_week, iso_day)[source]#
Gregorian calendar date for the given ISO year, week and day
- static iso_year_start(iso_year)[source]#
The gregorian calendar date of the first day of the given ISO year
- lossless = True#
The decoded output equals the input.
-
name:
str= 'date'#
- reverse(data, ref=None)[source]#
When reversing, the data column contains encoded data, whereas the ref column contains decoded/original data. Therefore, the referred columns have to be decoded first.
- Return type:
Series
- stateful = True#
Transformer fits variables.