I have a DataFrame df. This dataframe has 1000 rows and 20 columns. Rows are dates and 20 columns are different shares.
This is 1000 dates of stock prices from old to new (last row is todays price).
I want to calculate for each column, the percentile rank of todays price (last element in a column), against the full history of that particular column. So for example the first value of our output would be the final value in column (1) percentranked against all the values in column (1) and so on.
So the output would be just 20 values of 20xpercentage ranks of todays price against the history of the entire stock.