I have an array with 112 lines and 40 columns.
The format I need to convert to is 40 sets of 56 points each with x, y.
So, the first line has the x coordinates of the first point in each set. The second line has the x of the second points in the set... until the 56th line. After that I have the y's.
1st line : 40 x's
2nd line: 40 x's
...
56th line: 40 x's
57th line: 40 y's
...
112th line: 40 y's
Initially I thought about doing data.reshape(40, 56, 2) but that doesn't work because the values for x come before the values for y. If instead I had one line with x's and another with y's that would work though.
Edit:
for i in xrange(len(data)/2):
points.append(data[i])
points.append(data[i+len(data)/2])
points = np.array(points).T.reshape(len(data[0]), len(data)/2, 2)
return points