I have the below data
ID DD DAYS VALUE
1 08-MAR-19 4 500
1 09-MAR-19 1 1500
2 13-MAR-19 0 0
I want to select the maximum number of days like for ID 1 it will only return the row with 4. In SQL I use the below query
select aa.*, rank() over (partition by ID order by DAYS desc) rank_n;
Which returns only
ID DD DAYS VALUE
1 08-MAR-19 4 500
2 13-MAR-19 0 0
how can I do the same in pandas