[SciPy-user] concatenating arrays of different dimensions

Pauli Virtanen pav@iki...
Mon Feb 2 13:34:07 CST 2009


Mon, 02 Feb 2009 03:23:26 -0500, Pierre GM wrote:
> On Feb 2, 2009, at 3:12 AM, bgbg bg wrote:
> 
>> Hello,
>> Consider an Octave code that concatenates an array and a vector:
>> octave:1> a = [1, 2, 3];
>> octave:2> b = [ 11, 22, 33; 44, 55 66]; octave:3> c = [a; b]
>>
>>
>> How do I emulate this behavior in Python (scipy)? This is what i tried:
>>
>>
> c = np.vstack((a,b))
> 
> For more info:
> http://www.scipy.org/Numpy_Functions_by_Category#head-
ca5d5fe8c131a7ab8f7d7d38796ff84dbf4a2bd0

And http://docs.scipy.org/doc/numpy/reference/routines.array-manipulation.html#joining-arrays

-- 
Pauli Virtanen



More information about the SciPy-user mailing list