hello
I have done this NB to investigate the relation of fundamental factor with returns.
So in the first part i identified the best 50 and the worst 50 stock by percent returns (thanks to Jamie McCorriston for the help)
In the second part i compare the fundamental factors of the stock with best returns with the fundamental factors of the stock with worst returns to see the difference.
So normally it turns out that better fundamentals have positive returns and vice versa BUT in the recession of 2008 where things are different as you can see in the example attached.
Beside that i would appreciate some help in getting my comparison more statistically robust and not just looking at the values in the last two cells to see how much they differ, and also, the values are just the mean of all the best stocks vs the mean of all the worst stocks so it does take in consideration all the spikes that sometimes fundamental values have..
Edit: in the notebook uncomment the first line on In [16]:
fund_factors = unstacked.drop('returns', axis= 1, level= 0)