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.
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.
HMA1.
sample
Generate synthetic data for one table or the entire dataset.
If a table_name is given and sample_children is False, a pandas.DataFrame with the values from the indicated table is returned. Otherwise, if sample_children is True, a dictionary containing both the table and all its descendant tables is returned.
table_name
sample_children
False
pandas.DataFrame
True
If no table_name is given, the entire dataset is sampled and returned in a dictionary.
If num_rows is given, the root tables of the dataset will contain the indicated number of rows. Otherwise, the number of rows will be the same as in the original dataset. Number of rows in the child tables cannot be controlled and always will depend on the values from the sampled parent tables.
num_rows
If reset_primary_keys is True, the primary key generators will be reset.
reset_primary_keys
table_name (str) – Name of the table to sample from. If not passed, sample the entire dataset.
num_rows (int) – Amount of rows to sample. If None, sample the same number of rows as there were in the original table.
None
sample_children (bool) – Whether or not sample child tables. Used only if table_name is given. Defaults to True.
reset_primary_keys (bool) – Whether or not reset the primary keys generators. Defaults to False.
Returns a dict when sample_children is True with the sampled table and child tables.
dict
Returns a pandas.DataFrame when sample_children is False.
dict or pandas.DataFrame
NotFittedError – A NotFittedError is raised when the model has not been fitted yet.
NotFittedError