Autocorrelation Serial Correlation
# Convert index to datetime
df.index= pd.to_datetime(df.index)
# Downsample from daily to monthly data
df = df.resample(rule="M", how="last")
# rule: frequency (M is monthly)
# how: how to do resampling (first, last, average date of period)
df['Return'] = df['Price'].pct_change()
autocorrelation = df['Return'].autocorr()Last updated