I have a dataframe, indexed by date, containing information about the magnitude of floods - none, small, medium and large which are represented numerically by 0,1,2 and 3 respectively, see below (edited product of df.head(15).to\_dict()):

```
     date    flood
2001-01-01   0.0
2001-01-02   0.0
2001-01-03   0.0
2001-01-04   1.0
2001-01-05   1.0
2001-01-06   1.0
2001-01-07   0.0
2001-01-08   0.0
2001-01-09   2.0
2001-01-10   0.0
2001-01-11   3.0
2001-01-12   0.0
2001-01-13   0.0
2001-01-14   2.0
2001-01-15   0.0

```

I would like to resample by month (or other specified time period) and produce a count of the frequency of each category occurring. So the output would be something like this, for example:

```
            0     1     2     3
    date
1-1-2001    23    6     1     1
1-2-2001    20    7     1     0
1-3-2001    30    1     0     0
...

```

Any ideas how this might be achieved?

Thanks!!