import pandas as pd
import numpy as np
# 除了单个DataFrame 的运算之外,Pandas 也支持多个DataFrame 之间的算术运算
df1 = pd.DataFrame(np.random.randint(low=1, high=10, size=(3,3)), columns=['a','b','c'])
df2 = pd.DataFrame(np.random.randint(low=1, high=10, size=(3,3)), columns=['a','b','c'])
print(df1)
print(df2)
print(df1 + df2 * 2)
print((df1 + df2) / df1)
多个dataframe之间算术运算
最新推荐文章于 2023-02-08 15:10:26 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)