title: How can I insert a string value into a column of floats in pandas 0.24.2?
body: <p>I have a column of over a million floats. I need to be able to replace certain values with strings when that value falls above or below certain thresholds. </p>
  
  <pre><code>import pandas as pd
  
  import numpy as np
  
  df = pd.DataFrame({'foo': np.random.random(10),
                     'bar': np.random.random(10)})
  
  df
  Out[115]: 
          foo       bar
  0  0.181262  0.890826
  1  0.321260  0.053619
  2  0.832247  0.044459
  3  0.937769  0.855299
  4  0.752133  0.008980
  5  0.751948  0.680084
  6  0.559528  0.785047
  7  0.615597  0.265483
  8  0.129505  0.509945
  9  0.727209  0.786113
  
  df.at[5, 'foo'] = 'somestring'
  Traceback (most recent call last):
  
    File "&lt;ipython-input-116-bf0f6f9e84ac&gt;", line 1, in &lt;module&gt;
      df.at[5, 'foo'] = 'somestring'
  
    File "/Users/nate/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py", line 2287, in __setitem__
      self.obj._set_value(*key, takeable=self._takeable)
  
    File "/Users/nate/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 2815, in _set_value
      engine.set_value(series._values, index, value)
  
    File "pandas/_libs/index.pyx", line 95, in pandas._libs.index.IndexEngine.set_value
  
    File "pandas/_libs/index.pyx", line 106, in pandas._libs.index.IndexEngine.set_value
  
  ValueError: could not convert string to float: 'somestring'
  </code></pre>
  
  <p>I will eventually need to write something like:</p>
  
  <pre><code>for idx, row in df.iterrows()
      if row[0] &gt; some_value:
          df.at[idx, 'foo'] = 'over_some_value'
      else:
  </code></pre>
  
  <p>I have tried using <code>iloc</code>, but I suspect it would be to slow, and I would like to be able to use <code>at</code> to keep my code uniform.</p>