bayesline.api.equity.UniverseCountReportAccessorImpl#
- class bayesline.api.equity.UniverseCountReportAccessorImpl(accessor: ReportAccessorApi)#
- __init__(accessor: ReportAccessorApi)#
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
The underlying report accessor API.
scenario_types- __init__(accessor: ReportAccessorApi)#
- property accessor: ReportAccessorApi#
The underlying report accessor API.
Returns#
- ReportAccessorApi
The underlying report accessor API.
- 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.