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 index a 1D array with a 2D array.

On 2/14/11 5:24 PM, Robert Kern wrote:
On Mon, Feb 14, 2011 at 16:21, Bryan Woods<bwo...@aer.com>  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
roughness value for each class. I am trying to create a new 2D array
containing a map of the roughness values.
roughness = z0_legend[landcover]

<<attachment: bwoods.vcf>>

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to