On Fri, Sep 28, 2007 at 03:07:30PM -0400, Nadia Dencheva wrote:
> This should return an error and not silently truncate to int.
Why do you say that? The current behaviour is consistent and well
defined:
a[x] == a[int(x)]
We certainly can't change it now (just imagine all the code out there
that
This should return an error and not silently truncate to int.
Nadia
Lou Pecora wrote:
> Looks like it truncates to an int. But I wouldn't do
> it especially if you use floating operations (+,*,/,
> etc.) since what you get may not truncate to the
> integer you expect. Remember floats are approx
Looks like it truncates to an int. But I wouldn't do
it especially if you use floating operations (+,*,/,
etc.) since what you get may not truncate to the
integer you expect. Remember floats are approximate
representations for many rational numbers. Stick with
integers, IMHO.
--- Nadia Dencheva
Is indexing with floats really allowed in numpy?
>>> a=numpy.array([1,2,3,4])
>>> a[2.99]
3
Nadia Dencheva
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion