I am currently using Spyder from Anaconda and I am trying to convert an array containing type float to type int:
x = np.array([1, 2, 2.5]) x.astype(int) prin
astype returns a new array. You need to assign the result to x:
x
In [298]: x = x.astype(int) In [299]: x Out[299]: array([1, 2, 2])