如果我有以下数据帧:
id categories products
01 fruit Apple, Apricot
02 fruit Apple, Banana, Clementine, Pear
03 fruit Orange, Pineapple, Pear
04 vegetable Carrot, Cabbage
我想创建一个这样的新df,我该怎么办?谢谢。你知道吗
id products
01 (fruit)Apple, Apricot
02 (fruit)Apple, Banana, Clementine, Pear
03 (fruit)Orange, Pineapple, Pear
04 (vegetable)Carrot, Cabbage
只对字符串求和
试试这个
相关问题 更多 >
编程相关推荐