pandas 分组 合并多个元素

Posted cup_leo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pandas 分组 合并多个元素相关的知识,希望对你有一定的参考价值。

res.groupby([customer_id])[project_name].apply(lambda x:, .join(x)).reset_index()

x.groupby([sa])[daList].apply(lambda x:np.concatenate(list(x))).reset_index()
Out[340]: 
   sa            daList
0   2            [2, 3]
1   3         [4, 5, 9]
2   5  [44, 55, 23, 45]
3   7              [66]
————————————————
原文链接:https://blog.csdn.net/u011012422/article/details/82773618

 

以上是关于pandas 分组 合并多个元素的主要内容,如果未能解决你的问题,请参考以下文章