NumPy - Array Data Types
What will be the output of this code?
import numpy as np arr = np.array([1.9, 2.5, 3.1]) print(arr.astype(int))
import numpy as np arr = np.array([1.9, 2.5, 3.1]) print(arr.astype(int))
astype(int), NumPy truncates the decimal part (does not round).15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions