On Tue, 2 Oct 2018 at 08:56, <jamison.dono...@vanderbilt.edu> wrote:

> If I have a matrix  [1,0,1] [0,1,1] [0,0,0], [0,0,0], how do I delete the
> zero rows? (in this case rows 2 and 3). I know how to manually delete them,
> but what about for all cases, regardless of input. I want to have all the 0
> rows deleted in any matrix. Please Help!
>

sage: M = Matrix([[1,0,1], [0,1,1], [0,0,0], [0,0,0]])
sage: M
[1 0 1]
[0 1 1]
[0 0 0]
[0 0 0]
sage: Matrix(r for r in M.rows() if r)
[1 0 1]
[0 1 1]



> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to