pandas dataframe 同时操作两列 / 多列

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

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

你可能感兴趣的:(Python,数据挖掘)