int(x)报错:TypeError: only length-1 arrays can be converted to Python scalars
因为此函数只能传一个值进去,而你传了一个数组进去
试试:
x.astype(int)或者np.vectorize(x)
报错TypeError: only length-1 arrays can be converted to Python scalars
最新推荐文章于 2023-10-17 11:03:58 发布
int(x)报错:TypeError: only length-1 arrays can be converted to Python scalars
因为此函数只能传一个值进去,而你传了一个数组进去
试试:
x.astype(int)或者np.vectorize(x)