Skip to content

Relational data

class RelationalData

RelationalData.__init__

def __init__(data: Data, schema: Schema) -> None

Relational data structure.

Arguments:

  • data - A dictionary with table names as keys and pandas.DataFrame’s as values.
  • schema - A Schema object.

RelationalData.split

def split(ratio: float,
reset_index: bool = False,
rng: np.random.Generator | int | None = None) -> tuple[RD, RD]

Split the input data according to the given ratios for each root table.

Arguments:

  • ratio - Split ratio.
  • reset_index - Whether to reset the index of the resulting dataframes.
  • rng - Random state. If an int, it will be used as seed, if None the seed will be chosen randomly.

Returns:

Tuple with the two splits.