pandas 遍历行并更新

def valuation_formula(x, y):
    return x * y * 0.5

df['price'] = df.apply(lambda row: valuation_formula(row['x'], row['y']), axis=1)

你可能感兴趣的:(pandas 遍历行并更新)