擅长:python、mysql、java
<p>据我所知,您是否只是为了删除nat而过滤日期?那你就不是这样做的。事实上,熊猫有几个功能可以检查NAT,例如。熊猫.isnull(), 熊猫.notna(), 熊猫.DataFrame.notna()等:</p>
<p>下面是一个如何使用它的快速示例</p>
<pre><code> >>> import pandas as pd
>>> pd.isnull(np.datetime64('NaT'))
True
>>> d1[d1['New_Date'].notna()]
</code></pre>