How to compute the number of occurencies of elements in a list using list comprehensions in python?

后端 未结 0 422
北荒
北荒 2020-12-13 11:42

Given a list like this one

arr = [1, 1, 2, 2, 2, 3, 3]

I would like to compute the number of occurencies of each element and storing it in a new l

相关标签:
回答
  • 消灭零回复
提交回复
热议问题