3 odpowiedzi
+ 2
if you need to apply matrix multipication or dot.
import numpy as np
size = (int(input("input "+['x', 'y'][i])) for i in range(2))
m = []
for i in range(size[0]):
for j in range(size[1]):
m.append(int(input('input x:{} y:{}'.format(i, j))))
mat = np.matrix(m)
mat.size(size)
+ 4
rows = 3
[input().split() for i in range(rows)]
+ 4