pandas两列相乘

import pandas as pd
df=pd.read_csv("csv.csv")
df['mul']=df['num'].mul(df['sale'])
print(df)

'''
   num  sale  mul
0    2    49   98
1    2    93  186
2    1    78   78
3    2    67  134
4    1    89   89
5    1    50   50

'''

你可能感兴趣的:(pandas,python,数据分析)