Put the lesson NumPy Arrays into practice by writing a program yourself.
Three samples were each tested for hardness at four positions along their length. Each row of the table below is one sample and each column is one position.
Store the table as a 2D NumPy array and select parts of it.
(3, 4) [201 198 205 199] [149 199 176]
Write your program below and press Run. Each run is checked against the expected output.
Press Run to see what your program prints.
One possible solution. Other programs that print the same output are correct too.
import numpy as npreadings = [ [152, 160, 158, 149], [201, 198, 205, 199], [175, 172, 178, 176],]hardness = np.array(readings)print(hardness.shape)print(hardness[1])print(hardness[:, -1])