I am actually translating a matlab script into python an i have a problem using arrays in python (I am still a beginner) numpy. My question is this: In matlab I am computing the fourier transform of several signals and I am storing dynamically it in a 3 by 3 array say U. A simple example of what i want to do is as follows;
l = 3 ;
c = 0 ;
for i = 1:3
for j = 1:10
c=c+1 ;
a = j + 1;
U(i,c,:)=a ;
end
end
I want to translate this to python and I am unable to create the array U that stores dynamically the value of 'a' in U. Note : Here am computing 'a' as j+1 for simplicity but in my script 'a' is an array (the fourier transform of a signal)
Sorry for my bad english, I am french. T
numpy.numpyrequires that you initialize an array of the correct size first. See this recent question, also titleddynamically, stackoverflow.com/questions/42041016/…mat = np.empty(shape=(3, 30)). Check if I got the shape right.