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([[4, 2, 0, 4], [0, 2, 1, 1], [1, 1, 4, 2]]) In [16]: z0_legend Out[16]: array([ 3.4, 5.2, 1.3, 4.2, 6.4]) In [17]: roughness = z0_legend[land_cover] In [18]: roughness Out[18]: array([[ 6.4, 1.3, 3.4, 6.4], [ 3.4, 1.3, 5.2, 5.2], [ 5.2, 5.2, 6.4, 1.3]]) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion