Convert ndarray from float64 to integer

前端 未结 3 715
感情败类
感情败类 2020-12-15 02:31

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 thi

3条回答
  •  借酒劲吻你
    2020-12-15 03:01

    There's also a really useful discussion about converting the array in place, In-place type conversion of a NumPy array. If you're concerned about copying your array (which is whatastype() does) definitely check out the link.

提交回复
热议问题