I've got an ndarray
in python with a dtype
of float64
. I'd like to convert the array to be an array of integers. How should I do this?
int()
won't work, as it says it can't convert it to a scalar. Changing the dtype
field itself obviously doesn't work, as the actual bytes haven't changed. I can't seem to find anything on Google or in the documentation - what's the best way to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…