I think that the following does more or less what you want:
flex.show(grid[1:2,:])
Currently the multidimensional slicing only accepts slices as all the
arguments, not a mixture of slices and integers.
Richard
2012/1/2 Jan Marten Simons
Hi,
I've found a minor inconveniance using the flex type:
test case:
import numpy as np np_grid=np.double(np.zeros((3,7))) np_grid[1,3]=3.0 print(np_grid) # works print(np_grid[1,:]) # works
from cctbx.array_family import flex grid=flex.double(flex.grid(3,7)) grid[1,3]=3.0 flex.show(grid) #works flex.show(grid[1,:]) #gives error (see below)
"TypeError: All items must be of same type."
Is there another simple way to do sclices with flex arrays or could this be implemented the same way as in numpy by someone who is more into c++ than myself?
Thanks, Jan _______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb