[Numpy-discussion] force column vector

Charles R Harris charlesr.harris@gmail....
Wed Feb 7 22:46:59 CST 2007


On 2/7/07, Christian <ckkart@hoc.net> wrote:
>
> Sven Schreiber <svetosch <at> gmx.net> writes:
> > So I think what's needed is:
> >
> > b = array(yourlist)
> > b.reshape(b.shape[0], -1)


Row vectors are easy to get.

In [1]: asmatrix([1,2,3,4])
Out[1]: matrix([[1, 2, 3, 4]])

And nested lists work, but you will be stuck with using matrices.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070207/9f23f572/attachment.html 


More information about the Numpy-discussion mailing list