Skip to content

How to find the number of times a number appears in Python?

dict((i, a.count(i)) for i in a)
See also  Python code snippet - How to convert column to index in pandas?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.