Find the most frequent element in an array in Python.
[1, 3, 3, 3, 5, 4, 4, 6]
from collections import Counter 

def most_frequent(arr): 
 c = Counter(arr) 
 return c.most_common(1)[0][0]

arr = [1, 3, 3, 3, 5, 4, 4, 6] 
print(most_frequent(arr)) 
# Output: 3