bayesline.api.equity.AsyncUniverseCountReportAccessorImpl#

class bayesline.api.equity.AsyncUniverseCountReportAccessorImpl(accessor: AsyncReportAccessorApi)#
__init__(accessor: AsyncReportAccessorApi)#

Methods

__init__(accessor)

get_counts(*[, dates, ...])

Get the counts for the universe.

with_scenario(scenario_settings)

Return a new accessor with the given scenario settings applied.

Attributes

accessor

The underlying report accessor API.

scenario_types

__init__(accessor: AsyncReportAccessorApi)#
property accessor: AsyncReportAccessorApi#

The underlying report accessor API.

Returns#

AsyncReportAccessorApi

The underlying report accessor API.

async get_counts(*, dates: bool = True, categorical_hierarchy_levels: dict[str, int] | None = None) DataFrame#

Get the counts for the universe.

Parameters#

datesbool, default=True

If True, groups by dates.

categorical_hierarchy_levelsdict[str, int] | None, default=None

The level of categorical aggregation to group by. The key is the hierarchy name, the value is the level. If None, no categorical aggregation is done. A level of -1 means to use all levels.

Returns#

pl.DataFrame

A dataframe with [date, count] columns.