I have a dataframe.
Item Type Year_Month Total Cost
Cereal Jul-2017 6000
Cereal Jun-2017 5000
Baby Food Jul-2017 3000
Baby Food Jun-2017 2900
Snacks Jul-2017 4500
Snacks Jun-2017 4000
I wnat to sort the dataframe according to the difference of two rows of a single column. For example For Cereal the difference is 6000-5000 =1000 and for Snacks the difference is 4500-4000 = 500 and for baby food the difference is 3000- 2900 = 100
So the output should be like
Item Type Year_Month Total Cost
Cereal Jul-2017 6000
Cereal Jun-2017 5000
Snacks Jul-2017 4500
Snacks Jun-2017 4000
Baby Food Jul-2017 3000
Baby Food Jun-2017 2900