AddConstTransform¶
- class AddConstTransform(in_column: str, value: float, inplace: bool = True, out_column: Optional[str] = None)[source]¶
Bases:
etna.transforms.base.Transform
AddConstTransform add constant for given series.
Init AddConstTransform.
- Parameters
in_column (str) – column to apply transform
value (float) – value that should be added to the series
inplace (bool) –
if True, apply add constant transformation inplace to in_column,
if False, add transformed column to dataset
out_column (Optional[str]) – name of added column. If not given, use
self.__repr__()
- Inherited-members
Methods
fit
(df)Fit method does nothing and is kept for compatibility.
fit_transform
(df)May be reimplemented.
Apply inverse transformation to the dataset.
load
(path)Load an object.
save
(path)Save the object.
to_dict
()Collect all information about etna object in dict.
transform
(df)Apply adding constant to the dataset.
- fit(df: pandas.core.frame.DataFrame) etna.transforms.math.add_constant.AddConstTransform [source]¶
Fit method does nothing and is kept for compatibility.
- Parameters
df (pandas.core.frame.DataFrame) – dataframe with data.
- Returns
result
- Return type