quantlab.dataset.sharadar.membership.sp500_intervals#
- quantlab.dataset.sharadar.membership.sp500_intervals(vendor_root)[source]#
Return every S&P 500 membership spell in the raw SP500 table.
- Parameters:
- vendor_rootstr or Path
<download-dir>/sharadar, holding thesp500andtickersraw tables.
- Returns:
- pl.DataFrame
permaticker(Int64),start_dateandend_date(Date, both inclusive), one row per spell; touching spells of one permaticker are merged.
- Raises:
- ValueError
If the table is empty, a member to the table’s end has no permaticker in TICKERS, or a member’s ticker has several.
Examples
>>> sp500_intervals("/data/downloads/sharadar").columns ['permaticker', 'start_date', 'end_date']