Python: How can I save indexes of looped maximizer arguments in a vector?

77 Views Asked by At

I have a code like this:

for i_iter in range(0,max_iter):
    for j_now in range(0,400):
         V[j_now] = np.max(Matrix400_400[:,j_now] + beta * V_old)
    V_old = deepcopy(V)

and I would like to save the indices of the maximizers w.r.t Matrix400_400[:,j_now] in a vector called index. In Matlab this would just work like this:

[V(j_now), index(j_now)] = max(Matrix400_400(:,j_now) + beta*V_old')

But I need do know how this works in python...

Would be great if sb. could help me!

Cheers, Tobias

0

There are 0 best solutions below