get the most common element in an array.
a = np.array([[1, 2, 2], [3, 3, 3], [4, 4, 4], [4, 0, 0]]) al = list(a.flatten) res = max(set(al), key=al.count)