_OneSegmentResampleWithDistributionTransform

class _OneSegmentResampleWithDistributionTransform(in_column: str, distribution_column: str, inplace: bool, out_column: str)[source]

Bases: etna.transforms.base.OneSegmentTransform

_OneSegmentResampleWithDistributionTransform resamples the given column using the distribution of the other column.

Init _OneSegmentResampleWithDistributionTransform.

Parameters
  • in_column (str) – name of column to be resampled

  • distribution_column (str) – name of column to obtain the distribution from

  • inplace (bool) –

    • if True, apply resampling inplace to in_column,

    • if False, add transformed column to dataset

  • out_column (str) – name of added column. If not given, use self.__repr__()

Inherited-members

Methods

fit(df)

Obtain the resampling frequency and distribution from distribution_column.

fit_transform(df)

Fit and transform Dataframe.

inverse_transform(df)

Inverse transform Dataframe.

set_params(**params)

Return new object instance with modified parameters.

to_dict()

Collect all information about etna object in dict.

transform(df)

Resample the in_column using the distribution of distribution_column.

fit(df: pandas.core.frame.DataFrame) etna.transforms.missing_values.resample._OneSegmentResampleWithDistributionTransform[source]

Obtain the resampling frequency and distribution from distribution_column.

Parameters

df (pandas.core.frame.DataFrame) – dataframe with data to fit the transform.

Return type

etna.transforms.missing_values.resample._OneSegmentResampleWithDistributionTransform

inverse_transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Inverse transform Dataframe.

Parameters

df (pandas.core.frame.DataFrame) –

Return type

pandas.core.frame.DataFrame

transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Resample the in_column using the distribution of distribution_column.

Parameters

df (pandas.core.frame.DataFrame) – dataframe with data to transform.

Returns

result dataframe

Return type

pandas.core.frame.DataFrame