0

I am trying to rank some values in one column over a rolling period of N days instead of having the ranking done over the entire set. I have seen several methods here using rolling_apply but I have read that this is no longer in python. For example, in the following table; | | A | |:-------|:-----| |01-01-2013| 100| |02-01-2013| 85 | |03-01-2013| 110| |04-01-2013| 60| |05-01-2013| 20| |06-01-2013| 40|

For the column A above, how can I have the rank as below for N = 3;

A Ranked_A
01-01-2013 100 NaN
02-01-2013 85 Nan
03-01-2013 110 1
04-01-2013 60 3
05-01-2013 20 3
06-01-2013 40 2
evacoder
  • 11
  • 5
  • [How to ask a good pandas question](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples). – Quang Hoang Dec 26 '20 at 17:47
  • I'm pretty sure the answer is yes, but without a "good pandas question" so you can verify the results, it will be difficult for anyone to show you. – Scott Boston Dec 26 '20 at 17:49

0 Answers0