Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

most occurring element in array python

# let's say you got already array A
# print out each value below to undertand
from collections import Counter

c = Counter(A)
most_occured_elment = c.most_common(1)[0][0]
freq = c.most_common(1)[0][1]
 
PREVIOUS NEXT
Tagged: #occurring #element #array #python
ADD COMMENT
Topic
Name
8+4 =