I want to convert the elements(float) into integer, but it seems not working.
#get an array from a matrix
pre_dataY = data[:, -1]
print(pre_dataY)
# float to integer
for i in range(len(pre_dataY):
pre_dataY[i]=int(pre_dataY[i])
print(pre_dataY)
however, the output is :
[ 3. 2. 9. ..., 7. 5. 5.]
[ 3. 2. 9. ..., 7. 5. 5.]
I don't see why that is?