我有一个ID Visit11 Visit12 Visit13 Visit14 Visit15的输入数据帧
1 Orange
2 Orange
2 Apple
3 Grapes
4 Apple
5 Not Defined
5 Apple
6 Apple
7 Banana
7
7
7
7
7
7
8 Banana
8 Apple
8 Banana
8 Apple
8 Banana
9
9
9
9
我正在使用groupby获得预期的输出,但它将所有购买的内容都包含在一个单元格中。我想在不同的列中加入购买,其中一行代表一个用户。预期输出应为
ID Visit11 Visit12 Visit13 Visit1Int4 Visit15
1 Orange
2 Orange Apple
3 Grapes
4 Apple
5 Not Defined Apple
6 Apple
7 Banana
8 Banana Apple Banana Apple Banana
9
我相信你需要:
替代解决方案:
相关问题 更多 >
编程相关推荐