0

I have a matrix which is shape=(3,3) and the rows represent probablity distributions. This is an example:

distribution_probablities=np.array([[1/3,2/3,0], 
                               [0.5,0.2,0.3],
                               [1,0,0]])

I want to obtain a vector which has length 3 and each value represent the index of the selected probability. A possible resulting vector is this one: result=[1,0,0]
In the first row the second element has bigger chance to be selected, in the second one it is the same for the second element and so on.. Another possible result is: result=[0,2,0]. Is it possible to do it without a for loop over the rows?

0 Answers0