quantlab.dataset.sharadar.history.changes#

quantlab.dataset.sharadar.history.changes(config, securities, action, old, what, class_name)[source]#

Return each kept security’s changes of one kind: permaticker, date and old.

Parameters:
configSharadarDatasetConfig

Its raw_data_dir_path holds the actions and tickers raw tables.

securitiespl.DataFrame

The kept securities (sep_securities); a change of another is dropped.

actionstr

The ACTIONS type holding the old value, e.g. "sicchangefrom".

oldpl.Expr

The old value, from the ACTIONS columns, aliased to its output name.

whatstr

What changes, for error messages (“SIC”, “exchange”).

class_namestr

The caller’s name, for error messages.

Returns:
pl.DataFrame

permaticker, date and old’s column, sorted by permaticker and date.

Raises:
ValueError

If a security has two changes of this kind on one date.

Examples

changes(config, securities, "sicchangefrom", pl.col("value").alias("sic"), "SIC", "MyPanel")