Reputation: 1508
When doing Time series Analysis we need to set a frequency like this for monthly data:
df.index.freq = 'MS'
What frequency do I have to set if I have two hourly data (or 30 days data etc.)?
Thanks a lot!
Upvotes: 1
Views: 616
Reputation: 862521
I think you need Series.asfreq
if need change frequency:
df = df.asfreq('2H')
If need data processing - e.g. aggregate by sum
per 2 hours, 30 days:
df1 = df.resample('2H').sum()
df2 = df.resample('30D').sum()
Upvotes: 1