Let's say hypothetically I have a dataframe like this:
customer_id,purchase_date
A,2019-10-05
A,2019-10-02
A,2019-10-01
A,2019-10-03
B,2019-10-01
B,2019-10-03
C,2019-10-04
How do I generate a new column that shows the nth order progression for each customer so that I get a dataframe that looks something like this:
customer_id,purchase_date,order_num,
A,4
A,2
A,1
A,3
B,1
B,2
C,1