numeraire.core.sorts.aggregate_assigned_portfolios#
- numeraire.core.sorts.aggregate_assigned_portfolios(assignments: SortAssignments, returns: DataFrame, *, weights: DataFrame | None = None, direction: int = 1) SortResult[source]#
Aggregate frozen memberships into returns and the extreme-bin spread.
returnsandweightsare aligned toassignments.binsby labels.countsalways records formation membership, including an assigned asset whose realized return is missing. Equal-weighted returns use the finite realized returns in a bin. Value-weighted returns use only names having both a finite return and a strictly positive finite weight; missing, zero, or negative weights are excluded, and a bin with no usable weight remainsNaNrather than silently falling back to equal weighting.