title: Getting "AttributeError: 'float' object has no attribute 'replace'" error while replacing string
body: <p>I have a column which has text in it. I have to replace (':',' ').</p>
  
  <p>When I am running this code:</p>
  
  <pre><code>df["text"] = [x.replace(':',' ') for x in df["text"]]
  </code></pre>
  
  <p>I am facing the this error:</p>
  
  <pre><code>AttributeError: 'float' object has no attribute 'replace'
  
  AttributeError                            Traceback (most recent call 
  last)
  &lt;ipython-input-13-3c116e6f21e2&gt; in &lt;module&gt;
    1 #df["text"] = df["text"].astype(str)
  ----&gt; 2 df["text"] = [x.replace(':',' ') for x in df["text"]]
  
  &lt;ipython-input-13-3c116e6f21e2&gt; in &lt;listcomp&gt;(.0)
    1 #df["text"] = data["NOTES_ENT"].astype(str)
  ----&gt; 2 df["text"] = [x.replace(':',' ') for x in df["text"]]
  
  AttributeError: 'float' object has no attribute 'replace'
  </code></pre>