Answers for "python init matrix"

1

python init matrix

matrix = [ [ 0 for i in range(n) ] for j in range(m) ]
Posted by: Guest on April-19-2022
0

init matrix in numpy

>>> A = np.array([[4,7,6],[1,2,5],[9,3,8]])
>>> A
array([[4, 7, 6],
       [1, 2, 5],
       [9, 3, 8]])
>>> A.shape
(3, 3)
Posted by: Guest on February-26-2022

Python Answers by Framework

Browse Popular Code Answers by Language