0

I'm trying to create multiple rows of three arrays and then stack them vertically so that I would have 16 rows of array a above 16 of b above 56 of c.

import numpy as np
a=np.tile([25.5395,1.98040,20.2861,0.143384,11.9812,9.34972,4.50073,19.5810,0.689690],(16,1))
b=np.tile([19.5114,0.178847,8.23473,6.67018,2.01341,-0.29263,1.52080,12.9464,-13.280],(16,1))
c=np.tile([3.04850,13,2771,2.28680,5.70110,1.54639,0.323900,0.867000,32.9089,0.250800],(56,1))
d=np.vstack((a,b))
e=np.vstack((d,c))

The above code gives the error

'ValueError: all the input array dimensions except for the concatenation axis must match exactly'.

The error comes from the np.vstack line. Whilst I assume the error is self-explanatory as far as I can see the arrays do have the same dimensions along the non-concatenated axis as they each have length 9.

0

1 Answer 1

1

c has a length of 10.

Is the second element in c supposed to be 13.2771 instead of 13, 2771? (I assume so because then it would match the number of sig figs as the rest of the values). If so, then a, b, and c would all have length of 9.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.