[SciPy-dev] An addition to basic.py
nwagner at mecha.uni-stuttgart.de
Wed Apr 20 12:53:05 CDT 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.
> 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
> Scipy-dev mailing list
> Scipy-dev at scipy.net
More information about the Scipy-dev