Hi,
>>> import numpy as np
>>> a = np.arange(4)
>>> a[1.8]
1
>>> a[ np.array(1.8) ]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
IndexError: arrays used as indices must be of integer (or boolean) type
>>>

Why does numpy not accept float arrays as indices ?
I was very happy and quite surprised once I found out that it worked
at all for Python float scalars,
but would it not just be consequent to also allow float ndarrays then ?

Regards,
Sebastian Haase
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to