import numpy as np
arr1 = np.array([1, 2, 3, 4])
print("This array : " , arr1)
#printing the element with index 0 in this array
print("\nValue of index 0 is : " , arr1[0])
#printing the element with index 1 in this array
print("\nValue of index 0 is : " , arr1[1])
#printing the element with index 2 in this array
print("\nValue of index 0 is : " , arr1[2])
#printing the element with index 3 in this array
print("\nValue of index 0 is : " , arr1[3])
import numpy as np
arr1 = np.array([1, 2, 3, 4])
print("This array : " , arr1)
print("\nValue of index 2 is : " , arr1[2])
print("\nValue of index 3 is : " , arr1[3])
print("\nSum of the value of index 2 and 3 is : " , arr1[2] + arr1[3])
import numpy as np
arr2 = np.array([[1,2,3,4,5], [6,7,8,9,10]])
print("This array : " , arr2)
print('\nFisrt dimension of this array is', arr2[0])
print('\nSecond dimension of this array is', arr2[1])
import numpy as np
arr = np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]])
print(arr[0, 1, 2])
import numpy as np
arr2 = np.array([[1,2,3,4,5], [6,7,8,9,10]])
print("This array : " , arr2)
print('\nFisrt dimension of this array is', arr2[0])
print('\nThe value of index 0 in first dimension is : ', arr2[0,0])
print('\nThe value of index 1 in first dimension is : ', arr2[0,1])
import numpy as np
arr2 = np.array([[1,2,3,4,5], [6,7,8,9,10]])
print("This array : " , arr2)
print('\nSecond dimension of this array is', arr2[1])
print('\nThe value of index 0 in second dimension is : ', arr2[1,0])
print('\nThe value of index 1 in second dimension is : ', arr2[1,1])
import numpy as np
arr2 = np.array([[1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15]])
print("This array : " , arr2)
print('\nFisrt dimension of this array is', arr2[0])
print('\nSecond dimension of this array is', arr2[1])
print('\nThird dimension of this array is', arr2[2])
import numpy as np
arr2 = np.array([[1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15]])
print("This array : " , arr2)
print('\nFisrt dimension of this array is', arr2[0])
print('The value of index 0 in first dimension is : ', arr2[0,0])
print('The value of index 1 in first dimension is : ', arr2[0,1])
print('\nSecond dimension of this array is', arr2[1])
print('The value of index 0 in second dimension is : ', arr2[1,0])
print('The value of index 1 in second dimension is : ', arr2[1,1])
print('\nThird dimension of this array is', arr2[2])
print('The value of index 0 in third dimension is : ', arr2[2,0])
print('The value of index 1 in third dimension is : ', arr2[2,1])
import numpy as np
arr2 = np.array([[1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15]])
print("This array : " , arr2)
print('\nFisrt dimension of this array is', arr2[0])
print('The value of last element in first dimension is : ', arr2[0,-1])
print('\nSecond dimension of this array is', arr2[1])
print('The value of last element in second dimension is : ', arr2[1,-1])
print('\nThird dimension of this array is', arr2[2])
print('The value of last element in third dimension is : ', arr2[2,-1])