So i was trying to change my data to a frequency from monthly for better plot. my code is:
ice_cream_interest = pd.read_excel('book1.xlsx')
ice_cream_interest.set_index('Month', inplace= True)
ice_cream_interest = ice_cream_interest.asfreq(pd.infer_freq(ice_cream_interest.index))
with the data from ice_cream_interest itself are like this:
Month interest
0 2004-01 20
1 2004-02 21
2 2004-03 22
3 2004-04 25
4 2004-05 29
But after i ran my code, it gives :
interest
Month
2004-01-01 NaN
2004-02-01 NaN
2004-03-01 NaN
2004-04-01 NaN
2004-05-01 NaN
so i was wondering why the asfreq giving back a NaN, and how to fix it. Thank you!