📅  最后修改于: 2022-03-11 14:47:02.551000             🧑  作者: Mango
df = pandas.DataFrame({'A': [1, 3, 5], 'B': [7, 6, 2]})
df[A'] = df.apply(lambda x: 0 if x['A'] > x['B'] else x['A'], axis = 1)