Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

transpose of a matrix in python using loop

X = [[1, 3], [4,5], [7, 9]]

result = [[X[j][i] for j in range (len (X))] for i in range (len (X[0]))]

for r in result:

              print (r)
Source by www.toppr.com #
 
PREVIOUS NEXT
Tagged: #transpose #matrix #python #loop
ADD COMMENT
Topic
Name
4+5 =