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)
print x
The result still comes out unchanged:
[1. 2. 2.5]
Thoughts?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…