On 8/17/2010 12:13 AM, Alex Ter-Sarkissov wrote:
> I have an array (say, mat=rand(3,5)) from which I 'pull out' a row
> (say, s1=mat[1,]). The problem is, the shape of this row s1 is not
> [1,5], as I would expect, but rather [5,], which means that I can't,
> for example, concateante mat and s1 rowwise.


Your ``mat`` is an array.
You get the behavior you seek with NumPy matrices
(although I personally consider is a misfeature).

         >>> m = np.mat(mat)
         >>> m[1]
         matrix([[ 0.95488909,  0.55174423,  0.12103472,  0.15482402,  
0.71286625]])

hth,
Alan Isaac


_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to