I have a function `fn_weekly` that produces exactly what I want `1` if week has changed (on Mondays). `df` is any dataframe with timestamps for an index.

I'm trying to create a `fn_monthly` that outputs the same format, but I'm getting **floats** instead of **ints**.

**What am I doing wrong?**

Also, if there's a cleaner way to implement `fn_monthly`, do let me know. Thanks!

```
import pandas as pd

fn_weekly = lambda df: pd.DataFrame(df.index.isocalendar().week).diff()

fn_monthly = lambda df: pd.DataFrame(pd.Series(df.index.month, index=df.index)).diff()

>>> fn_weekly(df)
            week
Date
2019-02-04  <NA>
2019-02-05     0
2019-02-06     0
2019-02-07     0
2019-02-08     0
...          ...
2021-02-01     1
2021-02-02     0
2021-02-03     0
2021-02-04     0
2021-02-05     0

>>> fn_monthly(df)
            Date
Date
2019-02-04   NaN
2019-02-05   0.0
2019-02-06   0.0
2019-02-07   0.0
2019-02-08   0.0
...          ...
2021-02-01   1.0
2021-02-02   0.0
2021-02-03   0.0
2021-02-04   0.0
2021-02-05   0.0

```