df_1
product_name amount price
a 1 1
b 2 2
c 3 3
d 4 4
df_2
product_name amount
a 1
b 2
Run Code Online (Sandbox Code Playgroud)
这是熊猫中两个数据框的示例。
我希望把它减去amount与product_names
类似a产品将是amount0,b产品也达0 ...与product_name列的值。
谢谢你的时间