[Numpy-discussion] np.choose() question
Tue Jun 8 14:44:29 CDT 2010
On Tue, Jun 8, 2010 at 2:32 PM, Hans Meine
> Funny, that's exactly what I wanted to do (idx being a label/region image
> and what I tried today.
> You will be happy to hear that the even simpler solution is to just use
> fancy indexing (the name is justified here):
> will do the trick, too - no nead to flatten & reshape at all! :-)
> (Given that both are ndarrays of course.)
You have got the bonus points Hans!
I have a special ability to drag myself into list comprehensions for array
indexing questions. Numpy provides such simple operations where mortals like
me skip over easily or forget to convert lists as arrays before trying them.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion