edmontonpy.com
@edmontonpy
edmontonpy.slack.com
Andrew Crouse
Usman Rizwan
Python 3.8 Alpha 2
Using a counter.
from collections import Counter
# given a list of ratings of cats, 1-5
cat_ratings = [1,1,2,3,4,5,3,2,3,4,2,1,2,3]
# you can count the amount ratings with a counter
print(Counter(cat_ratings))
# output below:
# Counter({2: 4, 3: 4, 1: 3, 4: 2, 5: 1})
This is a great way to start your speaking at the meetup, and/or a great thing your working on please let us know.
You can let us know today or on slack:
@dgmouris @data-get @ashia @brian @abram
NEXT MEETUP ON APRIL 8TH