Indexing into a matrix is a means of selecting a subset of elements from the matrix/array
I have a 3d numpy array (n_samples x num_components x 2) in the example below n_samples = 5 and num_…