Strip string values in a dictionary and convert it to a float. Values contain numbers separated by space
<p>I have a dictionary setup with the following data:</p>

<p><img src="http://i.stack.imgur.com/onSzu.jpg" alt="image of dictionary with values"></p>

<p>where its values are a list of <strong>strings</strong>:</p>

<pre><code>['2 1 0\n', '3 0 1\n', '4 0 3\n' .... ]   
['-3.85995e-17  1.26224e+00  2.63053e-01\n']
</code></pre>

<p>Is there a way I can convert the values into a list of <strong>floats</strong> without having to use too many loops?</p>

<p>Thanks Xorgon!</p>

<p>I also tried using list comprehensions as follows:</p>

<pre><code>Connectivity = ['2 1 0\n', '3 0 1\n', '4 0 3\n']

aaa = [k.strip() for k in Connectivity]   
bbb =  [k.split() for k in aaa]
ccc = [[float(j) for j in i] for i in bbb] 
</code></pre>

<p>But is there a faster way? The reason being that the variable Connectivity would contain about 5million items</p>

python string dictionary