This function, from the tutorial does not work, can someone convert it to work with python 3.7. thanks.
Df['Corr']= pd.rolling_corr(Df['SMA'],Df['Close'].shift(1),window=n)
Hi Clint,
Can you please share the version of pandas that you are using, the error message and the traceback of the error.
Thanks,
Ashish
Thanks for your reply, however I have acquired the correct coding, but next time I will include more detail in my request. Thanks for your help.
The below code should work on a higher version of pandas.
Df['Corr']= Df['SMA'].rolling(window=n).corr(other=Df['Close'].shift(1))
The revised code solved my problem. Thank you very much.