create account

Python Program to Multiply Two Matrices by python-dev

View this thread on: hive.blogpeakd.comecency.com
· @python-dev ·
$0.38
Python Program to Multiply Two Matrices
``` 
# Program to multiply two matrices using nested loops

# 3x3 matrix
X = [[12,7,3],
    [4 ,5,6],
    [7 ,8,9]]
# 3x4 matrix
Y = [[5,8,1,2],
    [6,7,3,0],
    [4,5,9,1]]
# result is 3x4
result = [[0,0,0,0],
         [0,0,0,0],
         [0,0,0,0]]

# iterate through rows of X
for i in range(len(X)):
   # iterate through columns of Y
   for j in range(len(Y[0])):
       # iterate through rows of Y
       for k in range(len(Y)):
           result[i][j] += X[i][k] * Y[k][j]

for r in result:
   print(r)
 ```
👍  , , ,
properties (23)
authorpython-dev
permlinkpython-program-to-multiply-two-matrices
categorypython-dev
json_metadata{"tags":["python-dev"],"app":"hiveblog/0.1","format":"markdown"}
created2020-03-22 11:40:12
last_update2020-03-22 11:40:12
depth0
children1
last_payout2020-03-29 11:40:12
cashout_time1969-12-31 23:59:59
total_payout_value0.238 HBD
curator_payout_value0.144 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length514
author_reputation5,457,648,648,750
root_title"Python Program to Multiply Two Matrices"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id96,537,984
net_rshares1,516,520,380,744
author_curate_reward""
vote details (4)
@steemcleaners ·
$0.66
[Source](https://www.codespeedy.com/multiplication-of-two-matrices-using-numpy-python/)
[Plagiarism](http://www.plagiarism.org/plagiarism-101/what-is-plagiarism/) is the copying & pasting of others work without giving credit to the original author or artist. Plagiarized posts are considered fraud and violate the intellectual property rights of the original creator. 

Fraud is discouraged by the community and may result in the account being Blacklisted.
👍  
properties (23)
authorsteemcleaners
permlinkq7ltrf
categorypython-dev
json_metadata{"links":["https://www.codespeedy.com/multiplication-of-two-matrices-using-numpy-python/","http://www.plagiarism.org/plagiarism-101/what-is-plagiarism/"],"app":"hiveblog/0.1"}
created2020-03-22 16:57:15
last_update2020-03-22 16:57:15
depth1
children0
last_payout2020-03-29 16:57:15
cashout_time1969-12-31 23:59:59
total_payout_value0.330 HBD
curator_payout_value0.330 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length456
author_reputation2,789,224,428,782,668
root_title"Python Program to Multiply Two Matrices"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id96,541,608
net_rshares2,009,446,288,726
author_curate_reward""
vote details (1)