Re: [Numpy-discussion] conditional array indexing

2011-02-14 Thread Christopher Barker
On 2/14/11 2:39 PM, Bryan Woods wrote: > Thanks for your reply. Unfortunately it is not working that simply. > > This tells me that "only integer arrays with one element can be > converted to an index" Examples, example, examples! I think this is what you want: In [15]: land_cover Out[15]: array

Re: [Numpy-discussion] conditional array indexing

2011-02-14 Thread Pauli Virtanen
On Mon, 14 Feb 2011 17:21:07 -0500, Bryan Woods wrote: [clip] > roughness = np.array(landcover.shape,dtype='f') np.zeros(landcover.shape, dtype='f') ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/nump

Re: [Numpy-discussion] conditional array indexing

2011-02-14 Thread Robert Kern
On Mon, Feb 14, 2011 at 16:39, Bryan Woods wrote: > Thanks for your reply. Unfortunately it is not working that simply. > > This tells me that "only integer arrays with one element can be converted to > an index" > > roughness and landcover are identically shaped 2D arrays. z0_legend in a 1D > loo

Re: [Numpy-discussion] conditional array indexing

2011-02-14 Thread Bryan Woods
Thanks for your reply. Unfortunately it is not working that simply. This tells me that "only integer arrays with one element can be converted to an index" roughness and landcover are identically shaped 2D arrays. z0_legend in a 1D look-up table. I assume the error here comes from trying to in

Re: [Numpy-discussion] conditional array indexing

2011-02-14 Thread Robert Kern
On Mon, Feb 14, 2011 at 16:21, Bryan Woods wrote: > I have spent over an hour now trying to figure out what I thought would be a > really basic conditional array assignment. I am very new to python and am in > need of help. > > I have a 2D integer array of land cover classes and a 1D array with a

[Numpy-discussion] conditional array indexing

2011-02-14 Thread Bryan Woods
I have spent over an hour now trying to figure out what I thought would be a really basic conditional array assignment. I am very new to python and am in need of help. I have a 2D integer array of land cover classes and a 1D array with a roughness value for each class. I am trying to create a