[Numpy-discussion] faster Array.take( floatindices.astype(int) ) ?
Charles R Harris
Fri Feb 1 15:23:34 CST 2013
On Fri, Feb 1, 2013 at 6:24 AM, denis <firstname.lastname@example.org> wrote:
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion