I have 2 ND arrays:
x = zeros(shape=(N,9)); vx = zeros(shape=(N,9))
I also have 2 1D arrays:
x0 = [] # array with 9 elements
vx0 = [] # array with 9 elements
I want the following output:
x: [[ x0[0] 0. 0. ..., 0. 0. 0.][ x0[1] 0. 0. ..., 0. 0. 0.]... ]etc
vx : [[ vx[0] 0. 0. ..., 0. 0. 0.][ vx[1] 0. 0. ..., 0. 0. 0.]...]etc
I tried:
for k in range(8):
x[k:0] = x[k:0] + x0[k]
vx[k:0] = vx[k:0] + vx0[k]
print x
x[0] will be the first array in the x-array. x[0:0] will be the first element in the first list in the x-array
I get following output:
[[ 0. 0. 0. ..., 0. 0. 0.]
[ 0. 0. 0. ..., 0. 0. 0.]
[ 0. 0. 0. ..., 0. 0. 0.]
...] etc
But x0 contains floats different from 0.
Can someone help me with my issue or point me in the right direction?
EDIT: I used the Numpy module
x[0:0]
andx[3:0]
(etc.) to be in your loop overk
?zeros
are not builtin. Seems you are using numpy, right?