The number after the data type, ex. int64, represents the bitsize of the data type of a numpy array. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

The number after the data type, ex. int64, represents the bitsize of the data type of a numpy array.

Can someone please explain to me what this bitsize means and why it differs for some data e.g int32 for some and int64 for others

15th Apr 2020, 3:35 PM
Charles Itibi
Charles Itibi - avatar
2 Answers
+ 2
Every value in memory takes some space. A 32 bit integer, takes 32 bits, or 32 zeroes or ones. Divide that by 8 and you get the number of bytes, in this case 4. The smaller the data type (i.e the smaller the bitsize) the smaller the maximum value. An unsigned Int32 (32 bit integer) can hold numbers from 0 to 4 billion something.
15th Apr 2020, 9:41 PM
inxanedev!
inxanedev! - avatar
+ 1
Thank you, so integers are not just integers and can be further classified to be 32 bit and 64 bit integers
15th Apr 2020, 10:34 PM
Charles Itibi
Charles Itibi - avatar