Issue
I want to convert a = [1,2,3,4,5]
into a_string = "1 2 3 4 5"
. The real numpy array is quite big (50000x200) so I assume using for loops
is too slow.
Solution
You can use the join
method from string:
>>> a = [1,2,3,4,5]
>>> ' '.join(map(str, a))
"1 2 3 4 5"
Answered By - tito
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.