I have a dataframe showing daily rainfall between 1973 and 2013 that looks like this:
tp1
time
1973-04-01 0.1
1973-07-01 0.4
1973-08-01 0.0
1973-12-01 0.5
1973-01-17 0.0
...
2013-10-09 0.0
2013-11-09 0.2
2013-12-09 0.0
2013-09-13 0.4
2013-09-14 0.0
[6432 rows x 1 columns]
I'm trying to figure out the maximum daily rainfall in each month for every year, then take an average of each of the monthly values over the years , so the final datagram will contain only 12 rows be in the following format:
Average of Maximum Daily Rainfall in each Month
Jan x
Feb x
March x
April x
May x
June x
Jul x
....
I've tried the following command:
data = df.groupby(df.index.month).max()
However, what I believe this is doing is plotting the Maximum value of maximums rather than the average of maximums which is what I want.