On Tue, Jun 8, 2010 at 2:32 PM, Hans Meine <me...@informatik.uni-hamburg.de>wrote: > > > Funny, that's exactly what I wanted to do (idx being a label/region image > here), > 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): > > times[idx] > > 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. -- Gökhan
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion