Learn practical skills, build real-world projects, and advance your career
Created 3 years ago
!pip install jovian --upgrade -q
import numpy as np
function1 = np.shape
function2 = np.hsplit
function3 = np.hstack
function4 = np.dot
function5= np.trim_zeros
Function 1- np.shape(a)
Returns the shape of array a
sample1 = [[1, 2, 3], [4, 5 ,6]]
sample1NP = np.array(sample1)
print(np.shape(sample1NP))
#Prints (2, 3) 2 rows, 3 columns
(2, 3)
sample2= [1, 2, 3]
sample2NP = np.array(sample2)
print(np.shape(sample2NP))
#prints (3,) a flattened array
(3,)