title: list comprehension replace for loop in 2D matrix
body: <p>I try to use list comprehension to replace the for loop.</p>
  
  <p>original file is</p>
  
  <pre><code>2 3 4 5 6 3
  1 2 2 4 5 5
  1 2 2 2 2 4
  </code></pre>
  
  <p>for loop</p>
  
  <pre><code>line_number = 0
  for line in file:
      line_data = line.split()
      Cordi[line_number, :5] = line_data 
      line_number += 1
  </code></pre>
  
  <p>output is</p>
  
  <pre><code>[[2 3 4 5 6 3]
   [1 2 2 4 5 5]
   [1 2 2 2 2 4]]
  </code></pre>
  
  <p>if use list comprehension instead, for what I can think of is (I have to change the data type to int, so it can be plotted in later part of the program)</p>
  
  <pre><code>Cordi1= [int(x) for x in line.split() for line in data]
  </code></pre>
  
  <p>but the output is </p>
  
  <pre><code>[1, 1, 1]
  </code></pre>
  
  <p>but <code>line.split() for line in data</code> is actually a list, and if I try</p>
  
  <pre><code>Cordi1 = [int(x) for x in name of the list]
  </code></pre>
  
  <p>it works, why this happens?</p>