[SciPy-user] inverse of column_stack

Ryan Krauss ryanlists at gmail.com
Tue Feb 21 11:39:03 EST 2006


A.tolist() will already iterate over the rows of a matrix, but your
suggestion could easily be adapted to a cols function.

On 2/21/06, Stefan van der Walt <stefan at sun.ac.za> wrote:
> You can always do
>
> def rows(A):
>     nr_rows = x.shape[0]
>     for r in range(nr_rows):
>         yield A[r,:]
>
> for r in rows(A):
>     print r
>
> Cheers
> Stéfan
>
> On Tue, Feb 21, 2006 at 10:11:18AM -0500, Ryan Krauss wrote:
> > I think we misunderstood one another.  I want to iterate over the
> > columns of a matrix I already have.  This does what I want, I just
> > wondered if there was one built-in function that does this (or if
> > tolist could have an axis argument):
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>




More information about the SciPy-User mailing list