I have a datafile which is similar to (The original file is much bigger),

```
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

```

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

```
0.0 0.2 0.4
0.6 0.8
1.0

```

and the second one shows the number of elements in the y direction as,

```
0.0 0.4 0.6
1.2 1.6
2.0

```

Then each 6 number shows the value of contour in each row, starting from row 1 as,

```
1.0 3.0 4.0 1.0
1.0 3.0

```

I want to cast this data into a 2D array so that I can plot them.
I tried,

```
data = numpy.genfromtxt('fileHere',delimiter= " ",skip_header=1)

```

to read data into a general array and then split it. But I get the following error,

```
Line #16999 (got 15 columns instead of 3)

```

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

```
fscanf(fid,'%d',6);

```

I will be happy to have your ideas on this. Thanks