Feb. 21, 2006
4:52 p.m.
On Tue, Feb 21, 2006 at 11:39:03AM -0500, Ryan Krauss wrote:
A.tolist() will already iterate over the rows of a matrix, but your suggestion could easily be adapted to a cols function.
Also, the generator below does not copy data, unlike tolist.
On 2/21/06, Stefan van der Walt <stefan@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