两个DataFrame加减乘除

由于索引格式不同,所以不能直接进行运算。

解决办法:

重置索引,让两个frame索引名一样

yesclose_df.reset_index(drop=True)

然后就能直接进行运算了。

print (curclose_df – yesclose_df) / yesclose_df

转载随意~:陶醉seo » 两个DataFrame加减乘除

赞 (5)
分享到:更多 ()