NumPy - Array Data Types
Which of the following is the correct way to create a NumPy array of integers using
dtype?dtype?dtype with a string like 'int' or a NumPy dtype like np.int32.dtype='int' which is valid. np.array([1, 2, 3], type='int') uses wrong parameter type. np.array([1, 2, 3], dtype=int32) uses dtype=int32 without quotes or np.int32, which causes error. np.array([1, 2, 3], dtype='string') uses dtype='string' which is valid but not integer.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions