Important Notice:

Course Content
NumPy Basic in Python (Chapter-13) M3-R5
About Lesson

Slicing of 2 Dimensional Array:-

 

#Slicing in 2D array

import numpy as np

a=np.array([[10,20,30],[40,50,60],[70,80,90]])

print(a)

print(a[:2,::2])

Output:-

[[10 20 30]

 [40 50 60]

 [70 80 90]]

[[10 30]

 [40 60]]

 

error: Content is protected !!