我有一个Pandas数据框
Colour Type Cost Price Type
0 Red Car 3 5 Standard
1 Blue Bike 6 7 Standard
2 Blue Car 4 8 Standard
3 Green Bike 6 9 Standard
4 Yellow Bike 3 3 Standard
我有一系列的调整数据,想要将成本乘以这些数据并添加到底部。
Red 2
Blue 1
Green 3
因此,输出结果为:
Colour Type Cost Price Type
0 Red Car 3 5 Standard
1 Blue Bike 6 7 Standard
2 Blue Car 4 8 Standard
3 Green Bike 6 9 Standard
4 Yellow Bike 3 3 Standard
0 Red Car 6 10 Adjusted
1 Blue Bike 6 7 Adjusted
2 Blue Car 4 8 Adjusted
3 Green Bike 18 27 Adjusted
我有点迷茫,是否有更简单的方法来完成这个操作?
颜色
和成本
吗? - Finn