[SciPy-user] inverse of column_stack

Nils Wagner nwagner at mecha.uni-stuttgart.de
Tue Feb 21 08:58:09 CST 2006


Ryan Krauss wrote:
>Is there an inverse function to column_stack?  i.e. I want to iterate
>over the columns of a matrix.  I could first transpose it and then
>call tolist, but I was wondering if there was some clean, fast, built
>in way that I wasn't aware of.
>
>Thanks,
>
>Ryan
>
>_______________________________________________
>SciPy-user mailing list
>SciPy-user at scipy.net
>http://www.scipy.net/mailman/listinfo/scipy-user
>  
>>> a = rand(4*3)
>>> a
array([ 0.45210275,  0.45554869,  0.27096599,  0.72289623,  0.28874549,
        0.60064951,  0.36406786,  0.97709256,  0.68812732,  0.73081783,
        0.07033917,  0.50299293])
>>> a = transpose(reshape(a,(4,3)))
>>> a
array([[ 0.45210275,  0.72289623,  0.36406786,  0.73081783],
       [ 0.45554869,  0.28874549,  0.97709256,  0.07033917],
       [ 0.27096599,  0.60064951,  0.68812732,  0.50299293]])

 Nils



More information about the SciPy-user mailing list