The 32 in int32 stands for the amount of memory consumed to store the values. int datatypes are numbers without a decimal point. Print('Data type of Array 4', arr4.dtype)Īrray 1 : Īrray 3 : įrom the above results, we can see that the first array is of type float64, the second array is of type int32 and the third array is of type < U5. Print('Data type of Array 3', arr3.dtype) Print('Data type of Array 2', arr2.dtype) Print('Data type of Array 1', arr1.dtype) import numpy as npĪrr2 = np.random.randint(low=10, high=20, size=5)Īrr3 = np.array() We can check the data type of the elements in a numpy array using the dtype object. We already know that numpy arrays are homogenous arrays that stores a sequence of items which are of same data type. So, without much ado let us begin :) Check The Data Type of a NumPy array Get Started with the Best Python NumPy Tutorial for Beginners
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |