title: How can values in my dataframe be NaN and floats at same time
body: <p>I am trying to run PCA from sklearn and i keep getting <code>ValueError: Input contains NaN, infinity or a value too large for dtype('float64')</code>. It is surprising me since i used <code>df.dropna()</code> and <code>len(df)</code> went from 4096
   to 1566 after using <code>drop.na()</code>.</p>
  
  <p>I have tried many things like reseting index, making explicit copy etc., but nothing worked. Example below will demonstrate a minimal example of what seems weird behavior to me.</p>
  
  <pre><code>df_test = pd.DataFrame([[0.11, 0.22],[1.11, 1.22]], columns=['s1', 's2'])
  </code></pre>
  
  <p>when i do</p>
  
  <pre><code>df_test[df_test.isna()]
  </code></pre>
  
  <p>i get:</p>
  
  <pre><code>  s1  s2
  0 NaN NaN
  1 NaN NaN
  </code></pre>
  
  <p>and when:</p>
  
  <pre><code>df_test[~df_test.isna()]
  </code></pre>
  
  <p>i get:</p>
  
  <pre><code>   s1    s2
  0  0.11  0.22
  1  1.11  1.22
  </code></pre>
  
  <p>what i expect from</p>
  
  <pre><code>df_test[df_test.isna()]
  </code></pre>
  
  <p>is:</p>
  
  <pre><code>s1  s2
  </code></pre>
  
  <p>with no rows. How can values in my cells be a valid float64 and NaN at same time, it is rather confusing...</p>
  
  <p>UDPATE: Turns out NaNs were not the problem when running PCA, but in fact 2 infinity values crawled into my data and i didn't spot it in my 4096 x 15 dataframe until i realized NaNs were handled correctly all along. Thanks to all that replied!</p>