I've got a 2D matrix from numpy (np.zeros) and I would like that every element of this matrix is a 1D list with 2 elements, this is my code:
import numpy as np
N = 3
x = np.linspace(0,10,N)
y = np.linspace(0,10,N)
temp = np.zeros((N, N))
for i in range(len(x)):
for j in range(len(y)):
temp[i, j] = [x[i], y[j]]
but I've got error:
TypeError: float() argument must be a string or a real number, not 'list'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File (...), line 15, in <module>
temp[i, j] = [x[i], y[j]]
ValueError: setting an array element with a sequence.
And okay, I understand this problem, but I don't know how to solve it.