title: replace commas with point and convert values in floats (python dictionary)
body: <p>I need to convert some values (read as strings) in a python dictionary.</p>
  
  <p>Suppose this is my starting dictionary:</p>
  
  <pre><code>dd = {'sp': ['1,1', '3,2'], 'tt': ['a', 'b'], 'zz': [4.5, 2.1]}
  </code></pre>
  
  <p>what I would like to do is run a test on the dictionary values and if there is a comma (<code>,</code>) replace it with a point (<code>.</code>) and convert it in a float.</p>
  
  <p>In other words, dd should be transformed into this new dictionary:</p>
  
  <pre><code>dd = {'sp': [1.1, 3.2], 'tt': ['a', 'b'], 'zz': [4.5, 2.1]}
  </code></pre>
  
  <p>I thought this as a starting point:</p>
  
  <pre><code>for i, v in enumerate(d.values()):
      if ',' in v[i] and isinstance(v[i], str):
          float(v[i].replace(',', '.'))
  </code></pre>
  
  <p>but values are not <em>overwritten</em> in the original dictionary.</p>