MulaiMulai sekarang secara gratis

Transposing your masterpiece

You've learned that transposing an array reverses the order of the array's axes. To transpose the axes in a different order, you can pass the desired axes order as arguments. You'll practice with the 3D Monet rgb_array, loaded for you. numpy has been imported as np.

Latihan ini adalah bagian dari kursus

Introduction to NumPy

Lihat Kursus

Petunjuk latihan

  • Transpose the 3-D rgb_array so that the image appears rotated 90 degrees left and as a mirror image of itself.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Transpose rgb_array
transposed_rgb = ____
plt.imshow(transposed_rgb)
plt.show()
Edit dan Jalankan Kode