You are on page 1of 2

import numpy as np

a=np.array([[23,34,45],[56,78,76],[43,54,65],[234,54,76]])
print(a)
print(a.shape)

#For finding specific element in the array,Both below are same

print(a[0,1])
print(a[0] [1])

#1D ones

z=np.ones([2])
print(z)

#2D ones

s=np.ones([2,3])
print(s)

#1D zeros

fe=np.zeros([2])
print(fe)

#2D zeroes

de=np.zeros([2,3])
print(de)

#Linspace

er=np.linspace(1,11)
print(er)

#copy

we=np.array([[2,1],[21,3]],dtype=int)
print(we)

#Before Transpose(Matrix is noraml, rows and column)


g=np.array([[23,34,546,12],[243,56,23,346],[45,436,231,23]])
print(g)
print(g.shape)

#After transpose(Matrix is switched postitions, columns are rows,


rows are coluumns)

g=np.array([[23,34,546,12],[243,56,23,346],[45,436,231,23]])
print(g.T)
print(g.T.shape)

You might also like