When did numpy stop accepting floats as index. I get an error when using a float as an index, even when I use
x = np.arange(10)
i = 10 / 2
print(x[i])
I know this was deprecated, but cannot find back what version started to throw an error. I have many students submitting solutions to programming exercises that work for them and not for me. So their version is too old, but I want to know what version they need to upgrade to (I know the latest). When did numpy implement this change?
It's under version 1.12.0's release notes:
DeprecationWarning to error
- Indexing with floats raises IndexError, e.g., a[0, 0.0].
- Indexing with non-integer array_like raises IndexError, e.g., a['1', '2']
- Indexing with multiple ellipsis raises IndexError, e.g., a[..., ...].
- Non-integers used as index values raise TypeError, e.g., in reshape, take, and specifying reduce axis.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With