title: Python: How to read line by line in a numpy array?
body: <p>I would like to know can we read line by line in an array. For example:</p>
  
  <pre><code>array([[ 0.28,  0.22,  0.23,  0.27],
         [ 0.12,  0.29,  0.34,  0.21],
         [ 0.44,  0.56,  0.51,  0.65]])
  </code></pre>
  
  <p>To read the first line as in array form to perform some operation and then continue with second row array:</p>
  
  <pre><code>array([0.28,0.22,0.23,0.27])
  </code></pre>
  
  <p>What produces the above array is because of these two lines of code:</p>
  
  <pre><code>from numpy import genfromtxt
  single=genfromtxt('single.csv',delimiter=',')
  </code></pre>
  
  <p><strong>single.csv</strong></p>
  
  <pre><code>0.28,  0.22,  0.23,  0.27
  0.12,  0.29,  0.34,  0.21
  0.44,  0.56,  0.51,  0.65
  </code></pre>
  
  <p>Using <code>readlines()</code> seem like producing list instead of array. In my case, I'm using csv file. I'm trying to use the rows of values line by line instead of using them all together to avoid memory error. Can anyone help me?</p>
  
  <pre><code>with open('single.csv') as single:
      single=single.readlines()
  </code></pre>