title: DataFrame logic operations with NaN
body: <p>I'm trying to do some comparisons in a pandas DataFrame.  </p>
  
  <pre><code># create simple DataFrame
  df = pd.DataFrame(['one', 'two', 'three'], range(1,4), columns=['col1'])
  #df:
  #    col1
  #1    one
  #2    two
  #3  three
  
  # assign one col1 value to be NAN
  df.loc[1, 'col1'] = np.nan 
  # this comparison works
  print(df['col1'] == 'three')
  
  # assign all col1 values to NAN
  df.loc[:, 'col1'] = np.nan
  # this comparison fails
  print(df['col1'] == 'three')
  </code></pre>
  
  <p>The first comparison (with only one NAN value in the column) works as expected, but the second (with all NAN values in the column) produces this error: <code>TypeError: invalid type comparison</code></p>
  
  <p>What's going on here?  </p>
  
  <p>I saw this <a href="https://stackoverflow.com/questions/35278265/pandas-when-data-is-nan-logic-operations-cannot-be-done">question</a>, which suggests some possible but kind of hack-y solutions to this problem.  </p>
  
  <p>But why is this the behavior happening in the first place?  Is this restriction useful, somehow?  I can fix it by using <code>df.fillna('')</code> before my comparisons, but this seems clunky and irritating.  </p>
  
  <p>So my questions are:<br>
  1.  What is the cleanest way around this issue?<br>
  2.  Why is this the default behavior, anyway?</p>