[Numpy-discussion] faster Array.take( floatindices.astype(int) ) ?
Charles R Harris
charlesr.harris@gmail....
Fri Feb 1 15:23:34 CST 2013
On Fri, Feb 1, 2013 at 6:24 AM, denis <denis-bz-gg@t-online.de> wrote:
> Folks,
> is there a way to speed up Array.take( floatindices.astype(int) ) ?
> astype(int) makes a copy, floor() returns floats.
>
> (Is there a wiki of NumPy one-liners / various tricks ?
> would sure beat googling.)
>
You can use floats for the indices in the take method, they are floored
before use. That said, the Fortran FLOOR function returns integers and it
would be useful if numpy had integer versions of floor, ceil, divmod, say,
ifloor, iceil, idivmod that raised errors if the resulting integers
overflowed.
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130201/45e27db1/attachment.html
More information about the NumPy-Discussion
mailing list