panads一句代码将文本分类

df.groupby(['opponent']).game_id.nunique()=
for index,group in df.groupby(df['opponent'])['game_id']:
    print(index)
    print(len(set(list(group))))

 

posted @ 2020-11-25 08:58  hifalee  阅读(75)  评论(0编辑  收藏  举报