Hi 

I'm trying to split an array into two pieces and have the two pieces in a
new dimension.

Here it is in code, because that's hard to explain in words.

>>>data.shape
(4, 50, 3)
>>>new_data = numpy.zeros((2, 4, 25, 3))
>>>new_data[0,...] = data[:,:25,:]
>>>new_data[1,...] = data[:,25:,:]
>>>new_data.shape
(2, 4, 25, 3)

That works but when I try it with reshape the elements get in the wrong
place. I've tried various combinations of rollaxis before the reshape, but
can't get it right.

Thanks Eleanor


-- 
View this message in context: 
http://www.nabble.com/rollaxis-and-reshape-tp20943690p20943690.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.

_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to