I want to create a nxm ndarray with python as follows:
myarray = np.empty(n)
for index in range(5):
row = do_some_calculations(index)# returns an array of length n
np.stack[myarray, row])
which does not work. I get an error:
ValueError: all the input array dimensions except for the concatenation axis must match exactly
Also, I do not want the first row to be zeros. Do I have to use an if-else statement in the loop or is there a more pythonic way to do that?