title: numpy ValueError: cannot convert float NaN to integer
body: <p>I am trying to design a <code>np.where</code>argument which has the below inputs</p>
  
  <pre><code>r_label = np.array([['Fiscal data as of Dec 31 2016', '2016', '2015', '2014'],
         ['Fiscal data as of Dec 31 2016', '2016', '2015', '2014']],
          dtype='&lt;U29')
  
  x = pd.Int64Index([12, 12], dtype='int64')
  
  r_values_count = 2
  
  check = np.isnat(pd.to_datetime(r_label[:,1:][0], errors='coerce', format='%b %d %Y')).all()
  
  if_true =  [pd.to_datetime(r_label[:,1:][_], errors='coerce').map(lambda t: t.replace(month=x[_])) for _ in range(r_values_count)]
  
  if_false = [pd.to_datetime(r_label[:,1:][_], errors='coerce', format='%b %d %Y') for _ in range(r_values_count)]
  
  np.where(check, if_true, if_false)
  </code></pre>
  
  <p>but i am getting error  <code>ValueError: cannot convert float NaN to integer</code>. All the three parameters of <code>np.where</code> argument work perfectly well independently, I am not able to understand why it does now work inside <code>np.where</code> and how do i find where exactly is the code producing error</p>