# #31 Python Tutorial for Beginners | Working with Matrix in Python

///#31 Python Tutorial for Beginners | Working with Matrix in Python

## #31 Python Tutorial for Beginners | Working with Matrix in Python

Matrix Multiplication Theory :
Watch till 7:12 mins

Python Tutorial to learn Python programming with examples
Complete Python Tutorial for Beginners Playlist :
Python Tutorial in Hindi :

Editing Monitors :

Editing Laptop :
ASUS ROG Strix – (new version)

Camera :
lens :

Mics

Check out our website:

Telusko :
Navin Reddy :

Follow Navin Reddy on Instagram:

Subscribe to our other channel:
Navin Reddy :
Telusko Hindi :

Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20

source

By |2019-07-20T21:20:47+00:00July 20th, 2019|Python Video Tutorials|20 Comments

1. Telusko July 20, 2019 at 9:20 pm - Reply

Thank you for your Support Everyone.
Do share the playlist with your friends 🙂
Next Video : Before 9 pm IST , 27th July 2018

2. AKARSH suryavamshi July 20, 2019 at 9:20 pm - Reply

You are the Best PYTHON teacher in the whole world

3. rohini priya July 20, 2019 at 9:20 pm - Reply

its not working
from numpy import *
a=array([
[21,25,45],
[49,78,63]
])
print(a)

4. Python pro July 20, 2019 at 9:20 pm - Reply

Hai

5. Priyansh Jain July 20, 2019 at 9:20 pm - Reply

plzzz help me
from numpy import *
this statement cannot work

6. Madhan Madhan July 20, 2019 at 9:20 pm - Reply

how to get user input in numpy array???

7. Muhammad Hasnain Ali July 20, 2019 at 9:20 pm - Reply

Transpose of a matrix

from numpy import *

arr=array(

[

(1,2,3),(4,5,6)

]

)

newmat=[[0 for x in range(len(arr))]for y in range(len(arr[0]))]

for i in range(len(newmat[0])):

for j in range(len(newmat)):

newmat[j][i]=arr[i][j]

#Displaying Transpose

for i in range(len(newmat)):

for j in range(len(newmat[0])):

print(newmat[i][j],end=" ")

print("n")

8. swati Sawant July 20, 2019 at 9:20 pm - Reply

hie, I do enjoy programing in python. I come from Mechanical background, still Python seems easy. I don't understand how to study C and CPP. they are tough….

9. PRASHANTH KUMAR July 20, 2019 at 9:20 pm - Reply

have to take n rows & m column from user create 2-d array and ask user to insert values how?

10. Morteza Oskuei July 20, 2019 at 9:20 pm - Reply

from numpy import *

arr1=array([

[1,2,3],

[4,5,6]])

arr2=arr1.reshape(3,2)

arr3=ones((2,2))

for i in range(2):

for j in range(2):

c=0

for k in range(3):

f=arr1[i][k]*arr2[k][j]

c=c+f

arr3[i][j]=c

print(arr3)

11. SPARSH AGARWAL July 20, 2019 at 9:20 pm - Reply

from numpy import *

m1 = array([
[1,2],
[3,4]
])

m2 = array([
[2,1],
[4,3]
])
m3=array([[0,0],
[0,0]])
for i in range(2):
for j in range(2):
for k in range(2):
m3[i,j] = m1[i,k] * m2[k,j] + m3[i,j]

print(m1)
print(m2)
print(m3)

12. nikit vuppala July 20, 2019 at 9:20 pm - Reply

from numpy import *

m1 = matrix('1 2 3;4 5 6;7 8 9')

m2 = matrix('1 1 1;0 1 0;0 0 1')

l = []

for i in range(3):

for j in range(3):

s = 0

for k in range(3):

t = m1[i,k] * m2[k,j]

s+=t

l.append(s)

m = matrix(l)

print(m.reshape(3,3))

13. Mohit Raheja July 20, 2019 at 9:20 pm - Reply

m1 = array([1,2,3,4])
m2 = array([2,1,2,3])
x = len(m1)

y = len(m2)

for i in range(x):
for j in range(y):
print(m1[j]*m2[i],end=" ")

print()
"""
result
2 4 6 8
1 2 3 4
2 4 6 8
3 6 9 12

"""
how abt this?

14. jayank chandil July 20, 2019 at 9:20 pm - Reply

my code is not run sir it shows error

15. Akshay Parashar July 20, 2019 at 9:20 pm - Reply

Sir , how to take 2-d array user input ?

16. Akshay Parashar July 20, 2019 at 9:20 pm - Reply

#multiply two numbers
num1=int(input('Enter first number'))

num2=int(input('Enter second number'))

res=0

for i in range(0,num1):

res=res+num2

print(res)

17. Sanskar Jaiswal July 20, 2019 at 9:20 pm - Reply

how do i take inputs from user in multi dimension arrays ???

18. D- Zone July 20, 2019 at 9:20 pm - Reply

Can I know how to give input from key board to multiply two matrices.

19. Aman Singh July 20, 2019 at 9:20 pm - Reply