NUMPY BASIC EXERCISE 9
Create an array and print its dtype as complex
In this exercise we are going to create an array and print it while keeping its data type as complex.
Code
# dtype parameter import numpy as np arr = np.array([1, 2, 3], dtype = complex) print(arr)
Output
Code Editor
import numpy as np
arr = np.array([1, 2, 3], dtype = complex)
print(arr)