I know I saw it posted somewhere, but I can't seem to find it. I want to take several factors which are calculated in the pipeline and build a rank from them based on assigning each factor a weight. So, for each factor:
- Sort the stocks by the factor
- Normalize the numbers to between 0 and 1, then multiply by 100 so the ranks are 0 - 100 as 64-bit floats
- Apply a weight to each factor and build the final rank based on the weighted rank for each factor
I'm sure I can do this just looping over things, and I can probably figure out how to do it with NumPY given some time, but I swear I saw someone post something which does this for like 4 or 5 factors in just one line of code. Does anyone have a quick way to do it?