bayesline.api.equity.AsyncUniverseApi.counts

bayesline.api.equity.AsyncUniverseApi.counts#

abstract async AsyncUniverseApi.counts(dates: bool = True, industry_level: int = 0, region_level: int = 0, universe_type: Literal['estimation', 'coverage', 'both'] = 'both', id_type: Literal['bayesid', 'ticker', 'composite_figi', 'cik', 'cusip8', 'cusip9', 'isin', 'sedol6', 'sedol7', 'proxy', 'name'] | None = None, labels: bool = True) DataFrame#

Parameters#

dates: bool, optional

If True, groups by dates

industry_level: int, optional

The level of industry aggregation to group by. 0 means no industry aggregation, 1 means level 1, etc. Values greater than the max level are treated as the max level.

region_level: int, optional

The level of region aggregation to group by. 0 means no region aggregation, 1 means level 1, etc. Values greater than the max level are treated as the max level.

universe_type: Literal[“estimation”, “coverage”, “both”], optional

The type of universe to calculate the counts for.

id_type: IdType, optional

The id type to calculate the daily stats for, e.g. ticker, which is relevant as the coverage may differ by id type. The given id type must be supported, i.e. in id_types.

labels: bool, optional

If True, return labels for the counts, otherwise use the codes.

Returns#

pl.DataFrame

Universe counts. If grouped by dates then the count will be given. If not grouped by dates then the mean/min/max across all dates will be given.