HolidayTransform¶
- class HolidayTransform(iso_code: str = 'RUS', out_column: Optional[str] = None)[source]¶
Bases:
etna.transforms.base.Transform
,etna.transforms.base.FutureMixin
HolidayTransform generates series that indicates holidays in given dataframe.
Create instance of HolidayTransform.
- Parameters
iso_code (str) – internationally recognised codes, designated to country for which we want to find the holidays
out_column (Optional[str]) – name of added column. Use
self.__repr__()
if not given.
- Inherited-members
Methods
fit
(df)Fit HolidayTransform with data from df.
fit_transform
(df)May be reimplemented.
inverse_transform
(df)Inverse transforms dataframe.
transform
(df)Transform data from df with HolidayTransform and generate a column of holidays flags.
- fit(df: pandas.core.frame.DataFrame) etna.transforms.timestamp.holiday.HolidayTransform [source]¶
Fit HolidayTransform with data from df. Does nothing in this case.
- Parameters
df (pd.DataFrame) – value series with index column in timestamp format
- Return type
- transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame [source]¶
Transform data from df with HolidayTransform and generate a column of holidays flags.
- Parameters
df (pd.DataFrame) – value series with index column in timestamp format
- Returns
pd.DataFrame with added holidays
- Return type
pandas.core.frame.DataFrame