【发布时间】:2022-01-18 05:20:21
【问题描述】:
我在 DataFrame 中有一个列,其中包含一个流派数组
Row 1 genres = [Action, Adventure, Science Fiction, Thriller]
Row 2 genres = [Action, Crime, Thriller]
and so on...
如何获得列中所有单个类型的计数?
决赛桌结果:
Action 2
Adventure 1
Thriller 2
Science Fiction 1
Crime 1
【问题讨论】:
-
“最终表格”不必与原始长度(行数)匹配。它只需要计算原始值中的所有唯一值
-
您尝试了哪些方法,为什么没有成功?
标签: python arrays pandas dataframe arraylist