quantlab.dataset.sharadar.industry#
Point-in-time Fama-French 48 industry of each Sharadar security, keyed by permaticker.
TICKERS gives each security’s current SIC code (siccode); its
famaindustry, sicindustry and sector are current snapshots too,
and none of them is used here. The SIC history is rebuilt from ACTIONS’
sicchangefrom rows by quantlab.dataset.sharadar.history.sic_history,
which the listing panel (quantlab.dataset.sharadar.listing) reads too:
on a day, a security’s SIC is the sicchangefrom of its first change
dated after that day, or the current code when no change is later, so a
change dated on a weekend or holiday shows from the next trading day.
SharadarIndustryDataset classifies each day’s SIC into the Fama-French
48 industries (quantlab.dataset._support.ff48; a SIC inside no range is
48, “Other”), merges the thin industries named in
config.industry_merge, and stores the code as one float variable,
industry, on SEP’s trading days. A security’s industry is shown from its
TICKERS firstpricedate to its lastpricedate and is NaN outside them,
or where its SIC is unknown. The industry variable’s names attribute maps
each code that can appear (as a string) to French’s short name.
ACTIONS rows of a ticker outside SEP are dropped, and two SIC changes of
one security on one date are refused (sic_history). The
store grows with update(): new days are appended and a stored day is
never rewritten.
Examples#
Build the store and read a year:
config = SharadarIndustryConfig(
zarr_file_path="/data/quantlab/market/sharadar/sharadar_industry_1d/sharadar_industry_1d.zarr",
raw_data_dir_path="/data/quantlab/downloads/sharadar",
)
SharadarIndustryDataset(config).update()
panel = SharadarIndustryDataset(config).panel("2024-01-02", "2024-12-31")
panel["industry"].attrs["names"]["44"] # 'Banks'
Classes
Daily panel of each security's point-in-time Fama-French 48 industry code. |