quantlab.dataset.sharadar.point_in_time.to_panel#

quantlab.dataset.sharadar.point_in_time.to_panel(cells, days, symbols, variables)[source]#

Shape grid-ordered cells into a (timestamp, symbol) panel.

Parameters:
cellspl.DataFrame

One row per cell in on_grid order, a column per variable.

days, symbols

The axes the cells were built on.

variablesMapping[str, Mapping]

Each variable to take and its attributes (copied), in panel order.

Examples

>>> import polars as pl
>>> days = pl.Series("timestamp", ["2024-01-05", "2024-01-08"]).str.to_datetime(time_unit="ns")
>>> cells = on_grid(days, [101]).with_columns(value=pl.Series([1.0, 2.0]))
>>> to_panel(cells, days, [101], {"value": {"unit": "USD"}})["value"].values.tolist()
[[1.0], [2.0]]