IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Introduction to NumPy

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Create an array of zeros with three rows and two columns
zero_array = ____

# Print the data type of zero_array
print(____)
Modifica ed esegui il codice