Python 3.x 不推荐的pd.将_corr()滚动到第19页
如何更新Python 3代码的下一行,以调整pandas中已折旧的“pd.rollingcorr()”Python 3.x 不推荐的pd.将_corr()滚动到第19页,python-3.x,pandas,Python 3.x,Pandas,如何更新Python 3代码的下一行,以调整pandas中已折旧的“pd.rollingcorr()” FutureWarning: pd.rolling_corr is deprecated for Series and will be removed in a future version, replace with #Series.rolling(window=12).corr(other=<Series>) TX_AK_12corr = pd.rolling_corr(
FutureWarning: pd.rolling_corr is deprecated for Series and will be removed in a future version, replace with
#Series.rolling(window=12).corr(other=<Series>)
TX_AK_12corr = pd.rolling_corr(HPI_data['TX'], HPI_data['AK'], 12)
FutureWarning:pd.rolling\u corr不推荐用于系列,将在未来版本中删除,替换为
#Series.rolling(窗口=12).corr(其他=)
TX_AK_12corr=pd.rolling_corr(HPI_数据['TX'],HPI_数据['AK'],12)
其中TX是第一个系列,AK是第二个系列。12是窗户。当cor(X,Y)=cor(Y,X)时,顺序并不重要
corr1 = ser.rolling(12).corr(ser2)
corr2 = ser2.rolling(12).corr(ser)
corr1.equals(corr2)
Out: True
为了证实这一点,另一个是否无关紧要?也就是说,HPI_数据['AK'].rolling(12).corr(HPI_数据['TX'])也可以工作吗?是的,顺序并不重要。我已经更新了帖子。
corr1 = ser.rolling(12).corr(ser2)
corr2 = ser2.rolling(12).corr(ser)
corr1.equals(corr2)
Out: True