[Numpy-discussion] faster Array.take( floatindices.astype(int) ) ?

denis denis-bz-gg@t-online...
Sun Feb 3 05:28:37 CST 2013


Charles R Harris <charlesr.harris <at> gmail.com> writes:

> You can use floats for the indices in the take method, they are floored before
use. 

Chuck,
  that's in 1.7 ? In 1.6.2
    x = np.arange(10)
    x.take([3.14])
      array([3])
    x.take(np.array([3.14]))
    TypeError: array cannot be safely cast to required type
cheers
  -- denis




More information about the NumPy-Discussion mailing list