+ 2
what is dtype =int32?
4 Antworten
+ 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
+ 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.
+ 1
thank you