MulaiMulai sekarang secara gratis

Loading .npy files

The exercises for this chapter will use a NumPy array holding an image in RGB format. Which image? You'll have to load the array from the mystery_image.npy file to find out!

numpy is loaded as np, and mystery_image.npy is available.

Latihan ini adalah bagian dari kursus

Introduction to NumPy

Lihat Kursus

Petunjuk latihan

  • Load the mystery_image.npy file using the alias f, saving the contents as an array called rgb_array.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Load the mystery_image.npy file 
____

plt.imshow(rgb_array)
plt.show()
Edit dan Jalankan Kode