title: Replace values in a dataframe column that are below a certain threshold with NaN
body: <p>Let's say I have the following sample dataframe:</p>
  <pre><code>df = pd.DataFrame({'A': [4, 0.2, 3, 0.5], 'B': ['red', 'white', 'blue', 'green']})
  
       A      B
  0  4.0    red
  1  0.2  white
  2  3.0   blue
  3  0.5  green
  </code></pre>
  <p>I am trying to replace entries in a column that are below a certain threshold with NaN to look like the following:</p>
  <pre><code>     A      B
  0  4.0    red
  1  NaN  white
  2  3.0   blue
  3  NaN  green
  </code></pre>
  <p>Here is my attempt:</p>
  <pre><code>cutoff = 2
  df['A'] = df['A'].apply(lambda x: [y if y &gt; cutoff else None for y in x])
  </code></pre>
  <p>And the error I receive:</p>
  <pre><code>TypeError: 'float' object is not iterable
  </code></pre>
  <p>Where have I gone wrong? I assume it has to do with the <code>None</code> type</p>