Which of the following would extract all the first 3 rows of the last 5 columns in a given numpy 2D array ‘a’?
Answers
Answered by
6
Answer:
a[:3, -5:]
Explanation:
:3 parts represents rows i.e 0, 1, 2
-5: part represents column form -5 , -4, ... ,-1. This is using negative indexing. -1 is last column and column above -2 and so on.
Similar questions