Christian <[EMAIL PROTECTED]> writes:
> Hi,
>
> when creating an ndarray from a list, how can I force the result to be
> 2d *and* a column vector? So in case I pass a nested list, there will be no
> modification of the shape and when I pass a simple list, it will be
> converted to a 2d column ve
On 2/7/07, Christian <[EMAIL PROTECTED]> wrote:
Sven Schreiber 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
Sven Schreiber gmx.net> writes:
> So I think what's needed is:
>
> b = array(yourlist)
> b.reshape(b.shape[0], -1)
Yes! That is it.
Thanks, Christian
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listi
Christopher Barker noaa.gov> writes:
> I'm not sure I understand the specification of the problem. I would
> think that the definition of a column vector is that it's shape is:
>
> (-1,1)
I was not aware of that possibility althoug I own the book I - shame on me.
Thank you (and all others) for
Keith Goodman wrote:
> I'd like to know what the -1 means.
It means "fill in with whatever is necessary to make the size correct given the
other specified dimensions".
> But first I'm trying to figure out
> why there are two reshapes?
reshape() used to be simply a function, not a method.
> Do t
On 2/7/07, Sven Schreiber <[EMAIL PROTECTED]> wrote:
> Christopher Barker schrieb:
> > Christian wrote:
> >> when creating an ndarray from a list, how can I force the result to be
> >> 2d *and* a column vector? So in case I pass a nested list, there will be no
> >> modification of the shape and whe
Christopher Barker schrieb:
> Christian wrote:
>> when creating an ndarray from a list, how can I force the result to be
>> 2d *and* a column vector? So in case I pass a nested list, there will be no
>> modification of the shape and when I pass a simple list, it will be
>> converted to a 2d column
Christian wrote:
> when creating an ndarray from a list, how can I force the result to be
> 2d *and* a column vector? So in case I pass a nested list, there will be no
> modification of the shape and when I pass a simple list, it will be
> converted to a 2d column vector.
I'm not sure I understan
Christian schrieb:
> Hi,
>
> when creating an ndarray from a list, how can I force the result to be
> 2d *and* a column vector? So in case I pass a nested list, there will be no
> modification of the shape and when I pass a simple list, it will be
> converted to a 2d column vector. I can only thi
On Wed, Feb 07, 2007 at 10:35:14AM +, Christian wrote:
> Hi,
>
> when creating an ndarray from a list, how can I force the result to be
> 2d *and* a column vector? So in case I pass a nested list, there will be no
> modification of the shape and when I pass a simple list, it will be
> convert
Hi,
when creating an ndarray from a list, how can I force the result to be
2d *and* a column vector? So in case I pass a nested list, there will be no
modification of the shape and when I pass a simple list, it will be
converted to a 2d column vector. I can only think of a solution using 'if'
cla
11 matches
Mail list logo