MulaiMulai sekarang secara 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.

Latihan ini adalah bagian dari kursus

Introduction to NumPy

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

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

# Print the data type of zero_array
print(____)
Edit dan Jalankan Kode