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]
[
    110.076567
    108.096406
    102.34334
    90.175641
    94.512276
]