[Tutor] 2-D array to string
Eli Brosh
ebrosh at nana10.co.il
Fri Nov 23 14:39:50 CET 2007
Hello
I am starting to use pylab/numpy/scipy instead of MATLAB.
I now have a real beginners question (I think it is not really related to numpy)
I have a two-dimensional array
a=[[1,2,3],[4, 5, 6],[7,8,9]]
Is there a simple way to turn it into a multiline string ?
That is, turn a into:
s='''1 2 3 \n 4 5 6 \n 7 8 9'''
Thanks
Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071123/ed14f7a2/attachment.htm
More information about the Tutor
mailing list