[SciPy-dev] An addition to basic.py
Nils Wagner
nwagner at mecha.uni-stuttgart.de
Wed Apr 20 13:53:05 EDT 2005
On Wed, 20 Apr 2005 13:21:40 -0400 (Eastern Daylight Time)
Alan G Isaac <aisaac at american.edu> wrote:
> 1. I prefer the solution you can find in pyGAUSS:
> def vec(x): return transpose([ravel(transpose(x))])
> def vecr(x): return transpose([ravel(x)])
> In particular, I prefer to get back a 2-D array.
> 2. I suppose someone familiar with tensors should
> address the proper generalization beyond 2-D inputs.
>
> fwiw,
> Alan Isaac
>
>
Just a suggestion. And how about the reverse ?
a = rand(3,3)
b = vec(a)
a = transpose(reshape(a,(3,3))) # not the best way
Nils
>
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-dev
More information about the SciPy-Dev
mailing list