title: How to solve TypeError: expected string or bytes-like object
body: <p>I have typo errors in my data. In particular, I need to convert pandas DataFrame's column values from string to float. However, a simple <code>float(value)</code> fails throwing this error:</p>
  
  <pre><code>"could not convert string to float: '33q.200088'"
  </code></pre>
  
  <p>Therefore I apply regex to remove all non-digits:</p>
  
  <pre><code>re.sub(r"\D", "", num)
  </code></pre>
  
  <p>However, then I get the error <code>TypeError: expected string or bytes-like object</code> for the following case:</p>
  
  <pre><code>num = -97.94111109999999
  </code></pre>
  
  <p>Important: I want to maintain the <code>-</code> sign.</p>