title: Read data with missing values with Python into arrays
body: <p>I have a datafile which is similar to (The original file is much bigger),</p>
  <pre><code>Data
  6 6
  0.0 0.2 0.4
  0.6 0.8
  1.0
  0.0 0.4 0.6
  1.2 1.6
  2.0
  1.0 3.0 4.0 1.0
  1.0 3.0
  1.0 2.0 1.0 4.0
  5.0 2.0
  3.0 3.0 1.0 1.0
  5.0 1.0
  2.0 7.0 1.0 1.0
  5.0 2.0
  2.0 3.0 8.0 6.0
  3.0 1.0
  3.0 3.0 4.0 6.0
  1.0 1.0
  </code></pre>
  <p>and I need to plot it as a 2D contour.
  The first line is dummy, The first 6 shows the number of elements in the x direction as</p>
  <pre><code>0.0 0.2 0.4
  0.6 0.8
  1.0
  </code></pre>
  <p>and the second one shows the number of elements in the y direction as,</p>
  <pre><code>0.0 0.4 0.6
  1.2 1.6
  2.0
  </code></pre>
  <p>Then each 6 number shows the value of contour in each row, starting from row 1 as,</p>
  <pre><code>1.0 3.0 4.0 1.0
  1.0 3.0
  </code></pre>
  <p>I want to cast this data into a 2D array so that I can plot them.
  I tried,</p>
  <pre><code>data = numpy.genfromtxt('fileHere',delimiter= &quot; &quot;,skip_header=1)
  </code></pre>
  <p>to read data into a general array and then split it. But I get the following error,</p>
  <pre><code>Line #16999 (got 15 columns instead of 3)
  </code></pre>
  <p>I also tried the readline() and split() functions of Python but they make it much harder to continue. I want to have x and y in arrays and a separate array for the data in a let's say 6X6 shape. In Matlab I used to use the fscanf function</p>
  <pre><code>fscanf(fid,'%d',6);
  </code></pre>
  <p>I will be happy to have your ideas on this. Thanks</p>