[Numpy-discussion] np.choose() question

Gökhan Sever gokhansever@gmail....
Tue Jun 8 14:21:18 CDT 2010


If we were at so or ask.scipy I would vote for Mark's solution :)

Usually in cases like yours, I tend to use the shortest version of the
solutions.

On Tue, Jun 8, 2010 at 2:08 PM, Andreas Hilboll <lists@hilboll.de> wrote:

> Hi,
>
> > newtimes = [times[idx[x][y]] for x in range(2) for y in range(2)]
> > np.array(newtimes).reshape(2,2)
> > array([[104, 102],
> >            [103, 101]])
>
> Great, thanks a lot!
>
> Cheers,
>
> Andreas.
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Gökhan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100608/38da6633/attachment.html 


More information about the NumPy-Discussion mailing list