On Wednesday 29 October 2008 01:44:06 Adam wrote: > In [62]: temp2d = reshape(array3d,[23*337,107]) > > In [63]: temp2d2 = zeros([23*337,144]) > > In [64]: temp2d2[:,f.bolo_indices] = temp2d > > In [65]: array2d[whscan,:] = temp2d2 > > > This works, but it feels wrong to me: I think there should be a way to do > this by directly indexing array2d with two numpy arrays....
Does numpy.ix_ not fit your use case? In [2]: y = arange(15).reshape((3,5)) In [3]: y Out[3]: array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14]]) In [4]: y[ ix_( array([1,2]), array([1,3,4]) ) ] Out[4]: array([[ 6, 8, 9], [11, 13, 14]]) Regards, Ravi _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion