Axis = 0 means traversing the array from left to right i.e. along the rows Axis = 1 means traversing the array from top to bottom i.e. along the columns
Method name | Function |
---|---|
Np.array((x,y),dtype = int/float) | creates an array with the given values. Ex- > np.array([[1,2,3],[4,5,6]]) |
Np.empty | creates an empty array of given size filled with random values |
Np.ones | creates an array with 1's only |
Np.zeros | creates an array with 0's only |
Np.arange(start,over,step,dtype=int/float) | creates an array with start value iterates till the end value and steps over by the given step value |
Np.linspace(start,over,num=50,endpoint=True/False,dtype=int/float) | creates an array with given start and stop value and contains the number of elements specified. By default, it is 50. endpoint if declared true includes the stop value else excludes it. |