I have a df with information about sales per month-year like this:
sales     month-year
2         2017-01
5         2017-01
4         2017-02
3         2017-03
3         2017-03
I want to add a consecutive month number like this:
 sales     month-year   month-number
    2         2017-01   1
    5         2017-01   1
    4         2017-02   2
    3         2017-03   3
    3         2017-03   3
The original df contains data for multiple years, so 2018-01 should be 13 etc..
What is the best way to do this?
Thanks in advance
 
    