Good afternoon, I’m trying to split one two-dimensional array into three smaller ones, but the last line gets an error “SyntaxError: can’t assign to function call”. Python 3.6 version
Please tell me how to fix it
N = len (matrix)
M = len (matrix [0])
n = (N) // 3
A = np.zeros ((n, M))
for i in range (n):
for j in range (M):
A (i, j) = matrix (i, j)
Answer 1, authority 100%
A little bit wrong:
A (i, j) = matrix (i, j)
And this is correct:
A [i, j] = matrix [i, j]