Complete the code to create a NumPy array of integers.
import numpy as np arr = np.array([1, 2, 3], dtype=[1])
Using dtype='int' creates an integer array.
Complete the code to create a NumPy array of floats.
import numpy as np arr = np.array([1, 2, 3], dtype=[1])
Using dtype='float' creates an array with decimal numbers.
Fix the error in the code to create a NumPy array of booleans.
import numpy as np arr = np.array([0, 1, 2], dtype=[1])
Using dtype='bool' converts numbers to True/False values.
Fill both blanks to create a NumPy array of complex numbers.
import numpy as np arr = np.array([1, 2, 3], dtype=[1]) print(arr[2])
Use dtype='complex' to create complex numbers.
Use .dtype to print the data type of the array.
Fill all three blanks to create a NumPy array of strings and print its shape.
import numpy as np arr = np.array(["a", "b", "c"], dtype=[1]) print(arr[2]) print(arr[3])
Use dtype='str' to create an array of strings.
Use .dtype to print the data type.
Use .shape to print the array shape.
