I'm looking for a way to find the max value in each row of a 2-dim vector and save the indices of it in another vector. I know that i could do that with this code:
max_index = np.argmax(vec, axis=1)
Now my problem is when one row has multiple max values it takes the first index of it. Lets assume we have this matrix:
vec = [[1, 0 ,1],
[1, 2 ,3],
[0, 5 ,5]]
So i am thinking to replace the index of max with -1 when there is multiple max in one row. At the end max_index should be like this.
max_index = [-1, 2, -1]
Thanks in advance