I'm trying to create an n x m numpy array populated by a set of cosines like cos(v_t), cos(2 * v_t), cos(3 * v_t), ..., which I've tried to do with the following;
v_t = np.linspace(0,tmax,tsteps)
m_psi = np.zeros([tsteps,m])
for i in xrange(m):
for j in xrange(tsteps):
m_psi[j,i] = np.cos(v_t * k * 2 * pi/T)
k += 1
but this returns the error
ValueError: setting an array element with a sequence.
I need every element of the array to be one of these cosines, rather than a row or a column of the array being a cosine (because I'm going to perform some kind of operation like np.dot(R,m_psi), where R is another 2D array, and the result of this multiplication must also be a matrix).
EDIT: To clarify, I'm looking for something like
[[cos(v_t), cos(2*v_t), ...,cos(m*v_t)],
[cos((m+1)*v_t),cos((m+2)*v_t,...,cos(2*m*t)],
[etc.]]