默认情况下,哪些浮点精度是 numpy 数组?

Ben*_*oid 3 floating-point precision numpy

我想知道默认情况下 numpy 数组中的浮点格式是什么。(或者在声明 np.array 时它们是否会被转换?如果是的话,Python 列表怎么样?)例如 float16、float32 或 float64?

V. *_*rat 8

float64。你可以检查一下

>>> np.array([1, 2]).dtype
dtype('int64')
>>> np.array([1., 2]).dtype
dtype('float64')
Run Code Online (Sandbox Code Playgroud)