sdv.constraints.Inequality

class sdv.constraints.Inequality(low_column_name, high_column_name, strict_boundaries=False)[source]

Ensure that the high_column_name column is greater than the low_column_name one.

The transformation works by creating a column with the difference between the high_column_name and low_column_name columns and storing it in the high_column_name’s place. The reverse transform adds the difference column and the low_column_name to reconstruct the high_column_name.

Parameters
  • low_column_name (str) – Name of the column that contains the low values.

  • high_column_name (str) – Name of the column that contains the high values.

  • strict_boundaries (bool) – Whether the comparison of the values should be strict >= or not >. Defaults to False.

__init__(low_column_name, high_column_name, strict_boundaries=False)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(low_column_name, high_column_name)

Initialize self.

filter_valid(table_data)

Get only the rows that are valid.

fit(table_data)

Fit Constraint class to data.

fit_transform(table_data)

Fit this Constraint to the data and then transform it.

from_dict(constraint_dict)

Build a Constraint object from a dict.

is_valid(table_data)

Check whether high is greater than low in each row.

reverse_transform(table_data)

Handle logic around reverse transforming constraints.

to_dict()

Return a dict representation of this Constraint.

transform(table_data)

Perform necessary transformations needed by constraint.

Attributes

constraint_columns