In this example we will show how to check the data type of a NumPy array in Python.
Source Code
import numpy as np
a = np.array([1, 2, 3, 4, 5, 6])
print(a.dtype)
b = np.array(['a', 'b', 'c', 'python'])
print(b.dtype)
Output:
int32
<U6
In this example we will show how to check the data type of a NumPy array in Python.
import numpy as np
a = np.array([1, 2, 3, 4, 5, 6])
print(a.dtype)
b = np.array(['a', 'b', 'c', 'python'])
print(b.dtype)
Output:
int32
<U6