title: How to convert Pandas NaN to NaT
body: <p>I am trying to convert NaN (dtype: float64) values in a Pandas DataFrame column into NaT values.  </p>
  
  <p><strong>Please</strong> note that I have several DataFrames with the same <em>Order_date</em> column. Some <em>Order_date</em> columns' dtypes are float64 (filled with NaN) while others' dtypes are datetime64[ns] (filled with NaT).  </p>
  
  <p>I tried the following: </p>
  
  <pre><code>df.loc[:,'Order_date'] = df.loc[:,'Order_date'].astype(np.datetime64).fillna(pd.NaT)  
  </code></pre>
  
  <p>However, I get an Error result:  </p>
  
  <pre><code>TypeError: cannot astype a datatimelike from [datetime64[ns]] to [datetime64].  
  </code></pre>
  
  <p>What is reason behind this error? I think the error is due to how several Order_date columns in some DataFrames have NaT values (datetime64[ns]). <strong>What can I do to successfully convert only the Order_date columns with NaN values into NaT values in Pandas and leave the remaining Order_date columns that already have NaT values as is?</strong></p>