import numpy as np
a = np.array((1, 2, 3, 2, 3, 2, 1, 3))
occurences = np.where(a == a.max())
numpy.argmax: how to get the index corresponding to the *last* occurrence, in case of multiple occurrences of the maximum values