qis.df_to_equal_weight_allocation

qis.df_to_equal_weight_allocation(df, freq=None, index=None)[source]

equal weights across the assets observed on each date.

Equal-weight over the live universe rather than over the column count: an asset that has not started or has been delisted carries a NaN and is excluded from that date’s denominator, so the weights still sum to one as the universe changes.

Parameters:
  • df (Series | DataFrame) – panel whose non-NaN entries define which assets are live on each date

  • freq (str) – resample the weights to this frequency, forward-filling. None keeps the input dates

  • index (DatetimeIndex) – reindex the weights onto this index, forward-filling. Ignored when freq is given

Returns:

weights in the same shape, each row summing to one over the live assets

Return type:

Series | DataFrame