title: Back to inner for loop from outer loop - Python Nested Loop
body: <p>I have a case where I need 2 for loops (i and k) as shown below. And I want to continue with the inner loop after I left it. </p>
  
  <pre><code>import numpy as np
  X = [[12, 11, 1], [1,2,3]]
  mu = [1, 2, 3]
  sublist = []
  
  for i in range(0, 4):
      for k in range(0, 3):
          subtr = X[i] - mu[k]
          sublist.append(subtr)
      # leaving the loop k to calc argmin
      agmin = np.argmin(sublist)
      C.append(agmin)
          # Now I want to get back to the inner loop (k) to continue #further calculation, but obviously will result an error.
          np.dot((C[i] == k),X[i])    
  </code></pre>
  
  <p>What is the best way to deal with such cases?</p>