When dealing with a time series pandas dataframe with date index (working days from Monday to Friday), I tried to change the index frequency from None to 'D' for daily time series. I got the following error: ValueError: Inferred frequency None from passed values does not conform to passed frequency D
This is how my dataframe looks like:
And this is my code for setting the frequency:
df.index.freq = 'D'
df = df.asfreq('B')
'B' stands for business day frequency (Mon-Fri).