python - Error Msg: replace with Series.rolling(window=5).corr(other=<Series>) -
i trying find rolling correlation of 5 periods between columns ['high'] , ['low'].
i manage calculate there error:
futurewarning: pd.rolling_corr deprecated series , removed in future version, replace series.rolling(window=5).corr(other=)
tried replacing doesnt work. help?
import pandas pd df_gold = pd.read_csv('golddata.csv') df_gold['high_low'] = pd.rolling_corr(df_gold['high'],df_gold['low'],5) print(df_gold.tail())
try using
df['col1'].rolling(5).corr(df['col2'])#pandas v 0.20
notice
pd.rolling_corr(df['col1'],df['col2'],window=5)#panda v 0.17 (notice pd.rolling_corr deprecated series )
Comments
Post a Comment