
Numpy (Continued) Reshape Reshape is when you change the number of rows and columns which gives a new view to an object. import numpy as np a = np.array([(8,9,10),(11,12,13)]) print(a) b = a.reshape(6,1) print(b) -------------------------------------------------------------------------------------------------------------------- Slicing Slicing is basically extracting a particular set of elements from an array. import numpy as np a = np.array([(8,9),(10,11),(12,13)]) print(a[0:2,1]) # 2nd element from the zeroth and first index of the array import numpy as np a = np.array([(1,2,3,4),(3,4,5,6)]) print(a[0:, 2]) Few more example of slicing shown below: --------------------------------------------------------------------------------------------------------------------- linspace returns evenly spaced numbers over a specified interval. #It has printed 10 values between 1 to 3 import numpy as np a=np.linspace(1,3,10) ...