sdv/metadata/table.py
def reverse_transform(self, data):
        """Reverse the transformed data to the original format.

        Args:
            data (pandas.DataFrame):
                Data to be reverse transformed.

        Returns:
            pandas.DataFrame
        """
        if not self.fitted:
            raise MetadataNotFittedError()

        reversed_data = self._hyper_transformer.reverse_transform(data)

        for constraint in reversed(self._constraints):
            reversed_data = constraint.reverse_transform(reversed_data)

        for name, field_metadata in self._fields_metadata.items():
            field_type = field_metadata['type']
            if field_type == 'id' and name not in reversed_data:
                field_data = self._make_ids(field_metadata, len(reversed_data))
            elif field_metadata.get('pii', False):
                faker = self._get_faker(field_metadata['pii_category'])
                field_data = pd.Series([faker() for _ in range(len(reversed_data))])
            else:
                field_data = reversed_data[name]

            reversed_data[name] = field_data[field_data.notnull()].astype(self._dtypes[name])

        return reversed_data[self._field_names]
Reverse the transformed data to the original format.

        Args:
            data (pandas.DataFrame):
                Data to be reverse transformed.

        Returns:
            pandas.DataFrame
        
Reverse the transformed data to the original format.
Reverse the transformed data to the original format .
def reverse_transform(self, data):
        if not self.fitted:
            raise MetadataNotFittedError()
        reversed_data = self._hyper_transformer.reverse_transform(data)
        for constraint in reversed(self._constraints):
            reversed_data = constraint.reverse_transform(reversed_data)
        for name, field_metadata in self._fields_metadata.items():
            field_type = field_metadata['type']
            if field_type == 'id' and name not in reversed_data:
                field_data = self._make_ids(field_metadata, len(reversed_data))
            elif field_metadata.get('pii', False):
                faker = self._get_faker(field_metadata['pii_category'])
                field_data = pd.Series([faker() for _ in range(len(reversed_data))])
            else:
                field_data = reversed_data[name]
            reversed_data[name] = field_data[field_data.notnull()].astype(self._dtypes[name])
        return reversed_data[self._field_names]
def reverse_transform ( self , data ) : if not self . fitted : raise MetadataNotFittedError ( ) reversed_data = self . _hyper_transformer . reverse_transform ( data ) for constraint in reversed ( self . _constraints ) : reversed_data = constraint . reverse_transform ( reversed_data ) for name , field_metadata in self . _fields_metadata . items ( ) : field_type = field_metadata [ 'type' ] if field_type == 'id' and name not in reversed_data : field_data = self . _make_ids ( field_metadata , len ( reversed_data ) ) elif field_metadata . get ( 'pii' , False ) : faker = self . _get_faker ( field_metadata [ 'pii_category' ] ) field_data = pd . Series ( [ faker ( ) for _ in range ( len ( reversed_data ) ) ] ) else : field_data = reversed_data [ name ] reversed_data [ name ] = field_data [ field_data . notnull ( ) ] . astype ( self . _dtypes [ name ] ) return reversed_data [ self . _field_names ]
Reverse the transformed data to the original format.
Reverse the transformed data to the original format .
"""Reverse the transformed data to the original format.

        Args:
            data (pandas.DataFrame):
                Data to be reverse transformed.

        Returns:
            pandas.DataFrame
        """
None
self
data
Data to be reverse transformed.
Data to be reverse transformed .