[Numpy-discussion] conditional array indexing

Robert Kern robert.kern at gmail.com
Mon Feb 14 17:24:38 EST 2011

On Mon, Feb 14, 2011 at 16:21, Bryan Woods <bwoods at 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]

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the NumPy-Discussion mailing list