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

 

情境再现:

词云: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=['计数']

相关文章:

  • 2021-08-15
  • 2021-10-10
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-15
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案