reshape with xyz ordering

Heli hemla21 at gmail.com
Tue Jul 26 10:10:18 EDT 2016


Hi, 

I sort a file with 4 columns (x,y,z, somevalue) and I sort it using numpy.lexsort.

ind=np.lexsort((val,z,y,x))

myval=val[ind]

myval is a 1d numpy array sorted by x,then y, then z and finally val.

how can I reshape correctly myval so that I get a 3d numpy array maintaining the xyz ordering of the data?


my val looks like the following:

x,y,z, val
0,0,0,val1
0,0,1,val2
0,0,2,val3
...

Thanks a lot for your help, 



More information about the Python-list mailing list