Other packages Flashcards
1
Q
find the most common n items in a list
A
from collections import Counter data = Counter(arr) #data.most_common() # Returns all unique items and their counts data.most_common(n)
2
Q
find mode using python
A
max(set(arr), key = arr.count)