Syntax-
arr[rs:es:gap,cs:ce:gap]
-Here rs and es are the row starting and row ending points which are used to select the rows of the matrix.
-and cs and ce are the column starting and column ending points which select the column of the matrix.
program-
#import numpy
import numpy as np
l=[[1,2,3],[4,5,6],[1,1,1]]
arr=np.array(l)
print("nGiven array isn",arr)
s=arr[::,::]
print("After first slicingn",s)
s=arr[1:3,::]
print("After Second slicingn",s)
s=arr[0:3:1,0:1:1]
print("After Third slicingn",s)
Given array is
[[1 2 3]
[4 5 6]
[1 1 1]]
After first slicing
[[1 2 3]
[4 5 6]
[1 1 1]]
After Second slicing
[[4 5 6]
[1 1 1]]
After Second slicing
[[1]
[4]
[1]]