[Numpy-discussion] "Advanced indexing" question - subset of data cube as a 2D array.

Adam Ginsburg adam.ginsburg@colorado....
Wed Oct 29 11:11:43 CDT 2008


> In [85]: bi = (f.bolo_indices[np.newaxis,:]+
>
> ones([7751,1])).astype('int')
>
> In [86]: whc = (whscan[:,np.newaxis] + ones([1,107])).astype('int')
>
> In [87]: array2d[whc,bi] = temp2d
>
> I thought this had worked, but the values didn't seem to be going to the right places when I re-examined them.

I think I answered my own question: if I'd used zeros() instead of
ones() it would have worked fine.  I don't know why I tried to use
ones().

Adam


More information about the Numpy-discussion mailing list