what is dtype =int32? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
3rd Oct 2018, 9:39 AM
sama baluom
sama baluom - avatar
3 Answers
+ 2
int32 is an integer between -2^31 and 2^31 - 1. This range requires 32 bits of memory, and hence the name. Numpy allows for a variety of data types that are not present in regular Python, whose int type can be really, really large. Moreover, unlike Python's list, all elements of a Numpy array must be of the same type. These two facts together make Numpy really efficient in storing and manipulating data (at the cost of flexibility). Here is the list of Numpy data types: https://docs.scipy.org/doc/numpy-1.13.0/user/basics.types.html
3rd Oct 2018, 1:54 PM
Kishalaya Saha
Kishalaya Saha - avatar
+ 3
dtype gives you data type of your data.it is same as type built in function in python.type function gives you the data type of your variable or etc. e.g print(type(3)) #output=int because 3 is int and dtype is same but this function is uses in numpy module which gives you data type of data which is present in matrix.in your matrix data is int32.
3rd Oct 2018, 11:23 AM
Maninder $ingh
Maninder $ingh - avatar
+ 1
thank you
3rd Oct 2018, 11:35 AM
sama baluom
sama baluom - avatar