I know I can vectorize np.argmax via inputting a 2D array and specifying an axis, eg: np.argmax(2Darray,axis=1)
to get the maximum index per row.
I know in the event two entries are equal in a single 1D vector whereby I wish to return the maximum index, I can tiebreak them via np.random.choice(np.flatnonzero(1Dvector == 1Dvector.max()))
The question is, how can I do both together? Ie: How to vectorize np.argmax whereby equal entries are randomly tiebroken?