📜  来自其他人的 pandas 新专栏 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:15.292000             🧑  作者: Mango

代码示例1
import pandas as pd

#Here a and b are existing columns

df['c'] = df.apply(lambda row: row.a + row.b, axis=1)
df
#    a  b  c
# 0  1  3  4
# 1  2  4  6