Convert elements in a numpy array to string
<p>I wrote the following script to load data from CSV file in numpy array form:</p>

<pre><code>import numpy

sample = numpy.genfromtxt('sample_cor.csv', delimiter = ',')
print sample
</code></pre>

<p>and this <strong>sample</strong> looked like:</p>

<pre><code>[[  259463.392   2737830.062 ]
 [  255791.4823  2742050.772 ]
 [  249552.4949  2746152.328 ]
 [  247925.1228  2746422.143 ]
 [  262030.4697  2728966.229 ]
 [  260462.1936  2731412.856 ]
 [  260644.0281  2735003.027 ]
 [  268588.7974  2732835.097 ]]
</code></pre>

<p>now I want to extract every row in this array to string with a comma, for example, I expected row 1 to be converted to <code>259463.392,2737830.062</code>, row 2 to be <code>255791.4823,2742050.772</code>, and so on.</p>

<p>I tried the code below:</p>

<pre><code>ss = numpy.array_str(sample[0])
print ss
print type(ss)
</code></pre>

<p>and got the result maybe not what I want,</p>

<pre><code>[  259463.392  2737830.062]
&lt;type 'str'&gt;
</code></pre>

<p>(I used <code>coords = '259467.2,2737833.87'</code> and got the string form which was what I want:
<code>259467.2,2737833.87</code>)</p>

<p>How to convert elements in a numpy array to string with a comma?</p>