I have a multiindex dataframe with indexes date and id and I want to resample it as BM frequency. I am using the following code:
df.set_index('date').groupby('id').resample('BM').asfreq().drop('id',axis=1)
But for a given id it resampled till the last non-nan value and after that for this id I don't have a date, for example if for id A I have value for 2014 and 2019, I have a monthly index from 2014 to 2019 but nothing after 2019. Could you please help?