How to remove commas etc form a matrix in python

Posted by robert on Stack Overflow See other posts from Stack Overflow or by robert
Published on 2010-05-30T02:50:07Z Indexed on 2010/05/30 3:02 UTC
Read the original article Hit count: 291

Filed under:
|
|

say ive got a matrix that looks like:

[[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]

how can i make it on seperate lines:

[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]]

and then remove commas etc:

0 0 0 0 0

And also to make it blank instead of 0's, so that numbers can be put in later, so in the end it will be like:

_ 1 2 _ 1 _ 1

(spaces not underscores)

thanks

© Stack Overflow or respective owner

Related posts about python

Related posts about matrix