I have difficulty to use pd.rolling_mean function on the following data frame containing duplicated indices:
amount
20140101 3
20140102 4
20140103 3
20140103 5
20140103 1
20140104 5
20140105 6
20140106 2
…
I need to calculate the 3 day average of 'amount', for example, average from 20140101
to 20140103
should be (3+4+3+5+1)/5=3.2
, the average of amount from 20140104 to 20140106 should be (5+6+2)/3=4.3
does anyone know how to do it? Thank you in advance!