1
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],[...],...].

0

1 Answer 1

5

Next try:

Instead of

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

do

Theta = np.concatenate((Theta,[r]),axis=0)
Sign up to request clarification or add additional context in comments.

3 Comments

I don't have the values of r before the loop. So, it will not work. If I will create an empty array with zero's for r, outside the loop and then append values, it will not also work for me.
Here Theta should be a 2 dimensional array and output of theta should look like. Theta=[[12,56,58,45],[56,87,54,56],[...],...]
Can I append instead of concatenate?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.