title: Python for loop over matrix
body: <p>I have a problem with a small python program to cross-match two arrays. As a side note, I'm learning to code in Python in these days, so I assume I'm making some incredibly trivial mistake here.
  Basically, I want to open two .txt files, create a 2D array from each of them, and compare them to see if they have common elements.
  So far, I did something like this</p>
  
  <pre><code>#creating arrays from files
  models  = np.genfromtxt('models.txt', dtype='float')
  data    = np.genfromtxt('data.txt', dtype='float')
  
  #obtaining the number of rows in each array
  mod_nrows = models.shape[0]
  data_nrows = data.shape[0]
  
  #checking line by line if there are ay matches
  for i in range(mod_nrows)
      for j in range(data_nrows)
          do stuff....
  </code></pre>
  
  <p>but I'm getting the generic error</p>
  
  <pre><code>File "crossmatch.py", line 27
     for i in range(mod_nrows)
                          ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>I thought the problem might be that</p>
  
  <pre><code>mod_nrows = models.shape[0]
  </code></pre>
  
  <p>doesn't return an <code>int</code> (which should be the argument of the function range()), and I tried to change the two for loops to</p>
  
  <pre><code>for i in range(int(mod_nrows))
      for j in range(int(data_nrows))
          do stuff....
  </code></pre>
  
  <p>but I'm still getting the same error. Any suggestions?</p>