Answers for "how to print a matrix"

12

print matrix eleme

#Exemple:
M=[[1,2,3],[4,5,6],[7,8,9]]
#Converting Matrix elements to string (join() only work with str Matrix)
M=list(map(lambda i:[str(_) for _ in i],M))
[print(' '.join(i)) for i in M]
Posted by: Guest on April-16-2021
0

how to print a matrix in python

import numpy as np
print(np.matrix(A))
Posted by: Guest on March-02-2020

Python Answers by Framework

Browse Popular Code Answers by Language