Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how do i add two matrix and store it in a list in python

x = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
]

y = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
]
z = []

for i in range(3):
    for j in range(3):
        z.append(x[i][j] + y[i][j])

print(z)
Comment

PREVIOUS NEXT
Code Example
Python :: cashier program with class python 
Python :: how to plot graph between f1 score and random forest parameters 
Python :: ignore exception decorator 
Python :: Flask application displaying list of items from SQL database as text 
Python :: Trying to use image in Flask website only shows broken img icon 
Python :: SQLAlchemy ordering by count on a many to many relationship 
Python :: Python beginner question - trying to understand return statement 
Python :: python socket backlog 
Python :: penis command discord.py 
Python :: dataframe missing and zero values 
Python :: python request.args.get list 
Python :: list foreach pyhton 
Python :: ring print part of the content of a binary file 
Python :: python print replace old print 
Python :: pandas rolling list 
Python :: how to dynamically append value in a list in python 
Python :: dateentry python centered 
Python :: weigted average in pandas 
Python :: pandas to sql arabic 
Python :: dataframe from function 
Python :: python min date from dictionary 
Python :: ROC plot for h2o package 
Python :: scrollable dataframe 
Python :: python for skip header line 
Python :: fomat json load python 
Python :: Value Error handling 
Python :: Python[17586:513448] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to 
Python :: Select a Column in pandas data Frame Using dot notation 
Python :: load python 
Python :: As a general rule in python 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =