📜  int 数组到浮点数组 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:23.138000             🧑  作者: Mango

代码示例1
>>> import numpy as np
>>> A = np.array((0.4, 1.6, 2.1, -3.7, 2.9))
>>> A
array([ 0.4,  1.6,  2.1, -3.7,  2.9])
>>> A = A.astype(int)
>>> A
array([ 0,  1,  2, -3,  2])