我有一个数据集,看起来像这样,基本上是10,11和12的利润
Item 10/11 11/11 12/11
A 30 12 10
B 10 5 15
C 5 25 10
D 15 10 18
另一个数据帧:
Date Item A.unit B.Unit C.Unit D.Unit
10/11 A,D 5 0 0 12
11/11 A,B,C 10 10 5 0
12/11 A 20 0 0 0
表2中销售的单位可以是任何值 现在我想要表1中A、B、C和D的计划利润列,所以输出应该是这样的。你知道吗
Date Item A.unit A.Profit B.Unit B.Profit C.Unit C.Profit D.Unit D.Profit
10/11 A,D 5 30 0 10 0 5 12 15
11/11 A,B,C 10 12 10 5 5 25 0 10
12/11 A 20 10 0 15 0 10 0 18
有谁能帮我把这两张表的数据放到最后一张表里吗。你知道吗
源数据
处理数据
如果第一个
df1
中的Item
不是索引,第二个Date
不是索引,则解决方法:按} ,然后^{} ,最后按
Item
创建索引,首先转置和^{.
之前第三列的值排序:如果第一列是索引:
相关问题 更多 >
编程相关推荐