On Tuesday, October 16, 2012 12:43:09 AM UTC+2, someone wrote:
> On 10/15/2012 11:26 PM, MRAB wrote:
>
> > On 2012-10-15 22:09, someone wrote:
>
> >>
>
> >> See this:
>
> >>
>
> >> ==
>
> >> In [5]: Dx = numpy.matrix('1 0 0; 0 0.5 -0.5;
On 10/15/2012 11:26 PM, MRAB wrote:
On 2012-10-15 22:09, someone wrote:
See this:
==
In [5]: Dx = numpy.matrix('1 0 0; 0 0.5 -0.5; 0 -0.5 1.5')
In [6]: Dx
Out[6]:
matrix([[ 1. , 0. , 0. ],
[ 0. , 0.5, -0.5],
[ 0. ,
someone wrote:
How to initialize my array directly using variables ?
It could also be that I wanted:
test11 = 1
test12 = 1.5
test13 = 2
test21 = 0
test22 = 5
Dx = numpy.matrix('test11 test12 test13; test21 test22 -0.5; 0 -0.5 1.5')
Etc... for many variables...
Appreciate ANY help, thank you
On 15 October 2012 22:09, someone wrote:
>
> See this:
>
> ==**
> In [5]: Dx = numpy.matrix('1 0 0; 0 0.5 -0.5; 0 -0.5 1.5')
>
> In [6]: Dx
> Out[6]:
> matrix([[ 1. , 0. , 0. ],
> [ 0. , 0.5, -0.5],
> [ 0. , -0.5, 1.5]])
On 2012-10-15 22:09, someone wrote:
See this:
==
In [5]: Dx = numpy.matrix('1 0 0; 0 0.5 -0.5; 0 -0.5 1.5')
In [6]: Dx
Out[6]:
matrix([[ 1. , 0. , 0. ],
[ 0. , 0.5, -0.5],
[ 0. , -0.5, 1.5]])
==
On Oct 15, 2012 3:12 PM, "someone" wrote:
> How to initialize my array directly using variables ?
Why not just use the list-of-lists constructor instead of the string
constructor?
m = numpy.matrix([[1,2,3],[4,5,6],[7,8,test]])
--
http://mail.python.org/mailman/listinfo/python-list