Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-16 Thread Marco Nawijn
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; 0 -0.5 1.5') In

numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread someone
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]]) ==

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread Ian Kelly
On Oct 15, 2012 3:12 PM, someone newsbo...@gmail.com 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]]) --

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread MRAB
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]])

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread Joshua Landau
On 15 October 2012 22:09, someone newsbo...@gmail.com 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,

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread Emile van Sebille
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

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread someone
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.