将df中的数据,根据col0来进行分组,col3里的一组的合并为一个列表
df = df[['col0', 'col3']]
df_new = df.groupby('col0')['col3'].apply(lambda x:x.str.cat(sep = ',')).reset_index()
print(df)
print(df_new)
TypeError: Cannot use .str.cat with values of inferred dtype 'mixed'.
你想要的结果是什么样的呢,文字看不懂
想要的结果如图所示