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

Adam Ginsburg adam.ginsburg at colorado.edu
Wed Oct 29 12:11:43 EDT 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