title: KeyError: nan in dict
body: <p>I do as below</p>
  
  <pre><code>import numpy as np
  from numpy import nan
  df = pd.DataFrame({'a':[1, 2, 0, 1, np.nan, 2, 0]})
  mapper = {2.0: 0.0, 1.0: 1.0 ,0.0: 2.0, nan : nan}
  df['a'] = [ mapper[x] for x in df['a'] ]
  </code></pre>
  
  <p>and    </p>
  
  <pre><code>KeyError: nan
  </code></pre>
  
  <p>I tried to change dtypes</p>
  
  <pre><code>df['a'] = df['a'].astype(object)
  </code></pre>
  
  <p>but again </p>
  
  <pre><code>KeyError: nan
  </code></pre>
  
  <p>what's wrong?</p>