I wanted to create an mapping between two arrays. But in python, doing this resulted in a mapping with last element getting picked.
array_1 = [0,0,0,1,2,3]
array_2 = [4,4,5,6,8,7]
mapping = dict(zip(array_1, array_2))
print(mapping)
The mapping resulted in {0: 5, 1: 6, 2: 8, 3: 7}
How to pick the most occurring element in this case 4 for key 0.