Casting all elements of a list of lists to float in python
<p>I'm trying to cast all elements on a list of lists to float but when I do it like on the first loop below and then print their type, their types keep being the original ones. </p>

<pre><code>for x in f:
    for a in x:
        a = float(a) 

for x in f:
    for a in x:
        print(type(a),a)
</code></pre>

<p>Out of the print I get </p>

<pre><code>&lt;class 'numpy.str_'&gt; 0.0
&lt;class 'float'&gt; 0.0
&lt;class 'float'&gt; 1.0
&lt;class 'float'&gt; nan
&lt;class 'numpy.float64'&gt; 0.3
</code></pre>

<p>Shouldn't the first loop change the elements' types?</p>