[Numpy-discussion] What am I missing about concatenate?

Christopher Barker Chris.Barker at noaa.gov
Thu Jun 1 11:33:02 EDT 2006


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?

 >>> N.__version__
'0.9.6'

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the NumPy-Discussion mailing list