The dtype argument
One way to control the data type of a NumPy array is to declare it when the array is created using the dtype
keyword argument. Take a look at the data type NumPy uses by default when creating an array with np.zeros()
. Could it be updated?
numpy
is loaded as np
.
This exercise is part of the course
Introduction to NumPy
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create an array of zeros with three rows and two columns
zero_array = ____
# Print the data type of zero_array
print(____)