title: Keeping NaNs with pandas dataframe inequalities
body: <p>I have a pandas.DataFrame object that contains about 100 columns and 200000 rows of data. I am trying to convert it to a bool dataframe where True means that the value is greater than the threshold, False means that it is less, and NaN values are maintained. </p>
  
  <p>If there are no NaN values, it takes about 60 ms for me to run:</p>
  
  <pre><code>df &gt;= threshold
  </code></pre>
  
  <p>But when I try to deal with the NaNs, the below method works, but is very slow (20 sec). </p>
  
  <pre><code>def func(x):
      if x &gt;= threshold:
          return True
      elif x &lt; threshold:
          return False
      else:
          return x
  df.apply(lambda x: x.apply(lambda x: func(x)))
  </code></pre>
  
  <p>Is there a faster way?</p>