Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which float precision are NumPy arrays by default?

I wonder which format floats are in NumPy array by default. (or do they even get converted when declaring a np.array? if so how about python lists?) e.g. float16, float32, or float64?

like image 728
Benoid Avatar asked Sep 15 '25 05:09

Benoid


1 Answers

float64. You can check it like

>>> np.array([1, 2]).dtype
dtype('int64')
>>> np.array([1., 2]).dtype
dtype('float64')
like image 170
V. Ayrat Avatar answered Sep 17 '25 18:09

V. Ayrat