rahul_2008aust
rahul_2008aust

Reputation: 27

Concatenating arrays with numpy doesn't work

time=3600000    
count=0
l=0
while l<=time:    

    d=[12,37,45,67,98,45,90]
    t=0
    while t<=time:
        Theta_t=d*t
        r=[]
        r.append(Theta_t)
        t+=360

    if count==0:
        Theta=np.array([r])
    else:
        np.concatenate((Theta,[r]),axis=0)
    count+=1
    l+=360

Now, my problem is it does not append values to Theta which should be a two dimensional array with every column contains the values of r. Such as, Theta=[[12,56,58,45],[56,87,54,56],[...],...].

Upvotes: 1

Views: 3487

Answers (1)

Daniel S.
Daniel S.

Reputation: 6640

Next try:

Instead of

np.concatenate((Theta,[r]),axis=0)

do

Theta = np.concatenate((Theta,[r]),axis=0)

Upvotes: 5

Related Questions