【pandas】 dataframe 同时操作两列 / 多列

def my_test(a, b):
    return a + b

df['value'] = df.apply(lambda row: my_test(row['c1'], row['c2']), axis=1)

转载

https://blog.csdn.net/guotong1988/article/details/80887630?utm_source=blogxgwz9

posted @ 2020-08-06 12:18  HuaBro  阅读(2563)  评论(0编辑  收藏  举报