lace.Engine.draw

Engine.draw(row: int | str, col: int | str, n: int = 1)

Draw data from the distribution of a specific cell in the table.

Draw differs from simulate in that it is derived from the distribution of at a specific cell in the table rather than a hypothetical

Parameters:
  • row (row index) – The row name or index of the cell

  • col (column index) – The column name or index of the cell

  • n (int, optional) – The number of samples to draw

Returns:

A polars Series with n draws from the cell at (row, col)

Return type:

polars.Series

Examples

>>> from lace.examples import Satellites
>>> engine = Satellites()
>>> engine.draw(
...     "Landsat 7", "Period_minutes", n=5
... )  
shape: (5,)
Series: 'Period_minutes' [f64]
[
        125.0209
        173.739372
        103.887763
        115.319662
        98.08124
]