For a numpy array I have found that
x = numpy.array([]).reshape(0,4)
is fine and allows me to append (0,4) arrays to x without the array losing its structure (ie it dosnt just become a list of numbers). However, when I try
x = numpy.array([]).reshape(2,3)
it throws an error. Why is this?
(2,3)arrays along what axis? Use sample arrays to demonstrate what you have in mind?numpy.array([]).reshape(2,3)throws error becausenumpy.array([])has zero elements, so you can't reshape that to(2,3)that expects total6elements..reshape(0,4)expects zero elements0*4 = 0, while in(2,3), it expects2*3 = 6elems.