python array of unicodes to float conversion
<p>I have an array which looks as:</p>

<pre><code>MyArray
array(['1445.98', '1422.64', '1392.93', ..., '2012.21', '1861.19',
       '1681.02'], dtype=object)

type(MyArray[0])
</code></pre>

<p>I tried:</p>

<pre><code>MyArray.astype(np.float)
</code></pre>

<p>Error:</p>

<pre><code>ValueError: could not convert string to float: -   
</code></pre>

<p>How do I convert MyArray to array of floats instead.</p>

<p>Obviously some of your lines don't have valid float data</p>

<pre><code>map(lambda x: float(x),MyArray)
</code></pre>

<p>or </p>

<p>if you have a list</p>

<pre><code>[float(x) for x in MyList]
</code></pre>

python unicode