-
-
Save IndhumathyChelliah/77292af6640396d8a1ecb196e791c9cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
a1=np.array([10,20,30,40,50,60]) | |
#Single index | |
print (a1[3]) | |
#Output: 40 | |
#Slice | |
print (a1[2:5]) | |
#Output: [30,40,50] | |
#List of index | |
print (a1[[1,4]]) | |
#Output: [20 50] | |
#Slice with step | |
print (a1[1::2]) | |
#Output: [20 40 60] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment