On Thu, Jun 01, 2006 at 11:32:06AM -0700, Christopher Barker wrote:
I want to take two (2,) arrays and put them together into one (2,2) array. I thought one of these would work:
N.concatenate(((1,2),(3,4)),0) array([1, 2, 3, 4]) N.concatenate(((1,2),(3,4)),1) array([1, 2, 3, 4])
Is this the best I can do?
N.concatenate(((1,2),(3,4))).reshape(2,2) array([[1, 2], [3, 4]])
Is it because the arrays I'm putting together are rank-1?
concatenate is not meant to do that. Try putting your arrays in a list and building an array from that list. a1 = array([1,2]) a2 = array([3,4]) print array([a1, a2]) /bin/bash: q: command not found -- Alexandre Fayolle LOGILAB, Paris (France) Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services Informatique scientifique: http://www.logilab.fr/science