_OneSegmentResampleWithDistributionTransform

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

Bases: etna.transforms.base.Transform

_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 (Optional[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)

May be reimplemented.

inverse_transform(df)

Inverse transforms dataframe.

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

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