Danger

You are looking at the documentation for an older version of the SDV! We are no longer supporting or maintaining this version of the software

Click here to go to the new docs pages.

Tabular Constraints

FixedCombinations

FixedCombinations(column_names)

Ensure that the combinations across multiple columns are fixed.

FixedCombinations.fit(table_data)

Fit Constraint class to data.

FixedCombinations.transform(table_data)

Perform necessary transformations needed by constraint.

FixedCombinations.fit_transform(table_data)

Fit this Constraint to the data and then transform it.

FixedCombinations.reverse_transform(table_data)

Handle logic around reverse transforming constraints.

FixedCombinations.is_valid(table_data)

Say whether the column values are within the original combinations.

FixedCombinations.filter_valid(table_data)

Get only the rows that are valid.

FixedCombinations.from_dict(constraint_dict)

Build a Constraint object from a dict.

FixedCombinations.to_dict()

Return a dict representation of this Constraint.

Inequality

Inequality(low_column_name, high_column_name)

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

Inequality.fit(table_data)

Fit Constraint class to data.

Inequality.transform(table_data)

Perform necessary transformations needed by constraint.

Inequality.fit_transform(table_data)

Fit this Constraint to the data and then transform it.

Inequality.reverse_transform(table_data)

Handle logic around reverse transforming constraints.

Inequality.is_valid(table_data)

Check whether high is greater than low in each row.

Inequality.filter_valid(table_data)

Get only the rows that are valid.

Inequality.from_dict(constraint_dict)

Build a Constraint object from a dict.

Inequality.to_dict()

Return a dict representation of this Constraint.

ScalarInequality

ScalarInequality(column_name, relation, value)

Ensure an inequality between the column_name column and a scalar value.

ScalarInequality.fit(table_data)

Fit Constraint class to data.

ScalarInequality.transform(table_data)

Perform necessary transformations needed by constraint.

ScalarInequality.fit_transform(table_data)

Fit this Constraint to the data and then transform it.

ScalarInequality.reverse_transform(table_data)

Handle logic around reverse transforming constraints.

ScalarInequality.is_valid(table_data)

Say whether high is greater than low in each row.

ScalarInequality.filter_valid(table_data)

Get only the rows that are valid.

ScalarInequality.from_dict(constraint_dict)

Build a Constraint object from a dict.

ScalarInequality.to_dict()

Return a dict representation of this Constraint.

Positive

Positive(column_name[, strict])

Ensure the column_name column is greater than zero.

Positive.fit(table_data)

Fit Constraint class to data.

Positive.transform(table_data)

Perform necessary transformations needed by constraint.

Positive.fit_transform(table_data)

Fit this Constraint to the data and then transform it.

Positive.reverse_transform(table_data)

Handle logic around reverse transforming constraints.

Positive.is_valid(table_data)

Say whether high is greater than low in each row.

Positive.filter_valid(table_data)

Get only the rows that are valid.

Positive.from_dict(constraint_dict)

Build a Constraint object from a dict.

Positive.to_dict()

Return a dict representation of this Constraint.

Negative

Negative(column_name[, strict])

Ensure that the given columns are always negative.

Negative.fit(table_data)

Fit Constraint class to data.

Negative.transform(table_data)

Perform necessary transformations needed by constraint.

Negative.fit_transform(table_data)

Fit this Constraint to the data and then transform it.

Negative.reverse_transform(table_data)

Handle logic around reverse transforming constraints.

Negative.is_valid(table_data)

Say whether high is greater than low in each row.

Negative.filter_valid(table_data)

Get only the rows that are valid.

Negative.from_dict(constraint_dict)

Build a Constraint object from a dict.

Negative.to_dict()

Return a dict representation of this Constraint.

Range

Range(low_column_name, middle_column_name, …)

Ensure that the middle_column_name is between low and high columns.

Range.fit(table_data)

Fit Constraint class to data.

Range.transform(table_data)

Perform necessary transformations needed by constraint.

Range.fit_transform(table_data)

Fit this Constraint to the data and then transform it.

Range.reverse_transform(table_data)

Handle logic around reverse transforming constraints.

Range.is_valid(table_data)

Say whether the constraint_column is between the low and high values.

Range.filter_valid(table_data)

Get only the rows that are valid.

Range.from_dict(constraint_dict)

Build a Constraint object from a dict.

Range.to_dict()

Return a dict representation of this Constraint.

ScalarRange

ScalarRange(column_name, low_value, high_value)

Ensure that the column_name is between the range of low and high.

ScalarRange.fit(table_data)

Fit Constraint class to data.

ScalarRange.transform(table_data)

Perform necessary transformations needed by constraint.

ScalarRange.fit_transform(table_data)

Fit this Constraint to the data and then transform it.

ScalarRange.reverse_transform(table_data)

Handle logic around reverse transforming constraints.

ScalarRange.is_valid(table_data)

Say whether the column_name is between the low and high values.

ScalarRange.filter_valid(table_data)

Get only the rows that are valid.

ScalarRange.from_dict(constraint_dict)

Build a Constraint object from a dict.

ScalarRange.to_dict()

Return a dict representation of this Constraint.

OneHotEncoding

OneHotEncoding(column_names)

Ensure the appropriate columns are one hot encoded.

OneHotEncoding.fit(table_data)

Fit Constraint class to data.

OneHotEncoding.transform(table_data)

Perform necessary transformations needed by constraint.

OneHotEncoding.fit_transform(table_data)

Fit this Constraint to the data and then transform it.

OneHotEncoding.reverse_transform(table_data)

Handle logic around reverse transforming constraints.

OneHotEncoding.is_valid(table_data)

Check whether the data satisfies the one-hot constraint.

OneHotEncoding.filter_valid(table_data)

Get only the rows that are valid.

OneHotEncoding.from_dict(constraint_dict)

Build a Constraint object from a dict.

OneHotEncoding.to_dict()

Return a dict representation of this Constraint.

Unique

Unique(column_names)

Ensure that each value for a specified column/group of columns is unique.

Unique.fit(table_data)

Fit Constraint class to data.

Unique.transform(table_data)

Perform necessary transformations needed by constraint.

Unique.fit_transform(table_data)

Fit this Constraint to the data and then transform it.

Unique.reverse_transform(table_data)

Handle logic around reverse transforming constraints.

Unique.is_valid(table_data)

Get indices of first instance of unique rows.

Unique.filter_valid(table_data)

Get only the rows that are valid.

Unique.from_dict(constraint_dict)

Build a Constraint object from a dict.

Unique.to_dict()

Return a dict representation of this Constraint.