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.
This exercise is part of the course
Introduction to NumPy
Exercise instructions
- Load the
mystery_image.npyfile using the aliasf, saving the contents as an array calledrgb_array.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Load the mystery_image.npy file
____
plt.imshow(rgb_array)
plt.show()