title: reading data file into multidimensional array in python
body: <p>I am new to python. I want to read data from file and store it in a multidimensional array. For example, I have this, </p>
  
  <pre><code>6 5.9
  6.3 5.9
  6.6 6.3
  
  7.8 7.5
  7.8 7.3
  7.5 7.6
  
  8.3 8
  8.5 8
  8.2 8.3
  
  9.2 8.5
  9 8.5
  9.2 8.9
  </code></pre>
  
  <p>I want this stored in an array like this: </p>
  
  <pre><code>[ [['6', '5.9'], ['6.3', '5.9'], ['6.6', '6.3']], 
    [['7.8', '7.5'], ['7.8', '7.3'], ['7.5', '7.6']], 
        [['8.3', '8'], ['8.5', '8'], ['8.2', '8.3']], 
        [['9.2', '8.5'], ['9', '8.5'], ['9.2', '8.9']] ]
  </code></pre>
  
  <p>I have tried this so far: </p>
  
  <pre><code>with open("number.txt") as textFile:
      lines = [line.split() for line in textFile]
  print(lines)
  </code></pre>
  
  <p>And it gave me like this:</p>
  
  <pre><code>[['6', '5.9'], ['6.3', '5.9'], ['6.6', '6.3'], [], ['7.8', '7.5'], ['7.8', '7.3'], ['7.5', '7.6'], [], ['8.3', '8'], ['8.5', '8'], ['8.2', '8.3'], [], ['9.2', '8.5'], ['9', '8.5'], ['9.2', '8.9']]
  </code></pre>