Hi!
I need help in performing some calculations on a pandas dataframe.
MKT caps are fictional, also the factor all_categories_momentum_daily is fictional, I didn't bother giving the right numbers...
Given the attached notebook, I'm at the last cell and have df2, already divided in quantiles (quintiles in this case).
For now, I would like to add a new column, for each stock, called "weighted factor".
For every stock, in order to obtain this value, I need to divide each stock's mkt cap by the sum of the mkt cap of every quintile multiplied by each stock's all_categories_momentum_daily factor