[SciPy-user] Mathematica Element-wise Multiplication

Will Henney whenney at gmail.com
Mon Dec 17 14:01:34 EST 2007


Johann Cohen-Tanugi <cohen <at> slac.stanford.edu> writes:
> hmmm...... okay... What I wanted was to transpose a 1D array into a 
> vector, or vice-versa, with the linear algebra behavior in mind. I 
> understand that numpy does not follow this, but I cannot believe that 
> this behavior *is* what everybody wants! Tom's initial email was 
> symptomatic, and Stefan's response, with the proposal to use the T 
> method even more so!

I think you want to be using numpy.matrix, rather than numpy.array: 

In [17]: m = numpy.matrix([1, 2, 3])

In [18]: m.T

Out[18]: 
matrix([[1],
        [2],
        [3]])

Cheers

Will







More information about the SciPy-User mailing list