I have the following data:

```
            country  objectid  objectuse
record_date
2022-07-20    chile         0          4
2022-07-01    chile         1          4
2022-07-02    chile         1          4
2022-07-03    chile         1          4
2022-07-04    chile         1          4
...             ...       ...        ...
2022-07-26     peru      3088          4
2022-07-27     peru      3088          4
2022-07-28     peru      3088          4
2022-07-30     peru      3088          4
2022-07-31     peru      3088          4

```

The data describes the daily usage of an object within a country for a single month (July 2022), and not all object are used every day.

I am interested in finding the sum of the monthly maximums for the month, easy enough:

```py
df.groupby(['country', 'objectid']).max().groupby(level=0).sum()

         objectuse
country
chile         1224
peru         17008

```

However the thing that I am actually interested in is creating a rolling sum of the object maxima up to each day in the month within a country, for example:

```
            country       sum  
record_date
2022-07-01    chile         1
2022-07-01     peru         1
2022-07-02    chile         2
2022-07-02     peru         3
...             ...       ...
2022-07-31    chile       1224
2022-07-31     peru      17008

```

Is there a way to do this in pandas? I ultimately also want to do this via SQL but I was trying to find an approach that works first via pandas and without using the obvious approach which is looping and filtering the data based on the period that I am interested.