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.

sdv.constraints.OneHotEncoding.transform

OneHotEncoding.transform(table_data)

Perform necessary transformations needed by constraint.

Subclasses can optionally overwrite this method. If the transformation requires certain columns to be present in table_data, then the subclass should overwrite the _transform method instead. This method raises a MissingConstraintColumnError if the table_data is missing any columns needed to do the transformation. If columns are present, this method will call the _transform method. If _transform fails, the data will be returned unchanged.

Parameters

table_data (pandas.DataFrame) – Table data.

Returns

Input data unmodified.

Return type

pandas.DataFrame