NumPy - Array Data Types
What is the output dtype of this code?
import numpy as np arr = np.array([1.5, 2.5], dtype=np.float16) print(arr.dtype)
import numpy as np arr = np.array([1.5, 2.5], dtype=np.float16) print(arr.dtype)
dtype=np.float16, so the array elements are stored as float16.arr.dtype will show float16 as the data type.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions