词云:FutureWarning: using a dict on a Series for aggregation is deprecated and will be removed问题

版权声明:本文为博主原创文章,未经博主允许也可以得转载。 https://blog.csdn.net/zrcshendustudy/article/details/82355903

词云FutureWarning: using a dict on a Series for aggregation is deprecated and will be removed问题

 

情境再现:

 

 

代码:

words_stat=words_df.groupby(by=['segment'])['segment'].agg({"计数":numpy.size})

 

分析问题:

写法不对,

解决问题:

 

words_stat=words_df.groupby(by=['segment'])['segment'].agg(numpy.size)

words_stat=words_stat.to_frame()

words_stat.columns=['计数']

猜你喜欢

转载自blog.csdn.net/zrcshendustudy/article/details/82355903