sf_quant.data.load_scores#
- sf_quant.data.load_scores(start: date, end: date, names: list[str] = None) DataFrame#
Load a Polars DataFrame of scores data between two dates.
Parameters#
- startdatetime.date
Start date (inclusive) of the data frame.
- enddatetime.date
End date (inclusive) of the data frame.
- nameslist of str, optional
List of signal names to filter the data frame by. If None (default), all signal names are included.
Returns#
- polars.DataFrame
A DataFrame containing scores data between the specified dates.
Examples#
>>> import sf_quant.data as sfd >>> import datetime as dt >>> start = dt.date(2024, 1, 1) >>> end = dt.date(2024, 12, 31) >>> df = sfd.load_scores( ... start=start, ... end=end, ... names=["momentum"] ... ) >>> df.head() shape: (5, 4) ┌────────────┬─────────┬─────────────┬───────────┐ │ date ┆ barrid ┆ signal_name ┆ score │ │ --- ┆ --- ┆ --- ┆ --- │ │ date ┆ str ┆ str ┆ f64 │ ╞════════════╪═════════╪═════════════╪═══════════╡ │ 2022-01-03 ┆ USA3871 ┆ momentum ┆ 0.324434 │ │ 2022-01-03 ┆ USBDIJ1 ┆ momentum ┆ 1.239903 │ │ 2022-01-03 ┆ USA91R1 ┆ momentum ┆ -0.019291 │ │ 2022-01-03 ┆ USBFCZ1 ┆ momentum ┆ 0.17957 │ │ 2022-01-03 ┆ USAA181 ┆ momentum ┆ 0.227943 │ └────────────┴─────────┴─────────────┴───────────┘