📜  pandas group by concat - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:58.190000             🧑  作者: Mango

代码示例1
In [124]:

df.groupby(['name','month'])['text'].apply(lambda x: ','.join(x)).reset_index()

Out[124]:
    name  month         text
0  name1     11       hej,du
1  name1     12        aj,oj
2  name2     11     fin,katt
3  name2     12  mycket,lite