I'm running into some trouble converting values in columns into a Numpy 2d array. What I have as an output from my code is something the following:
38617.0 0 0
40728.0 0 1
40538.0 0 2
40500.5 0 3
40214.0 0 4
40545.0 0 5
40352.5 0 6
40222.5 0 7
40008.0 0 8
40017.0 0 9
40126.0 0 10
40029.0 0 11
39681.5 0 12
39973.0 0 13
39903.0 0 14
39766.5 0 15
39784.0 0 16
39528.5 0 17
39513.5 0 18
And this continues for ~300,000 lines. The coords of the data are arranged as (z,x,y), and I want to convert it into a 2d array with dimensions 765X510 (x,y) so that the z-coordinates are sitting at their respective (x,y) coordinates so that I may write it to an image file.
Any ideas? I've been looking around and I haven't found anything on the matter.
EDIT:
This is the while-loop that's creating the above columns of data (it's actually two, a function is called within another while-loop):
def make_median_image(x,y):
while y < 509:
y = y + 1 # Makes the first value (x,0), b/c Python is indexed at 0
median_first_row0 = sc.median([a11[y,x],a22[y,x],a33[y,x],a44[y,x],a55[y,x],a66[y,x],a77[y,x],a88[y,x],a99[y,x],a1010[y,x]])
print median_first_row0,x,y
list1 = [median_first_row0,x,y]
list = list1.append(
while x < 764:
x = x + 1
make_median_image(x,y)