Aram 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.

Use a 2D slice:

>>> a = array([[1,2],[3,4]])

>>> a
array([[1, 2],
       [3, 4]])

>>> b = a[1:2,:]

>>> b
array([[3, 4]])

>>> b.shape
(1, 2)

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to