nat = np.datetime64('NaT')
nat == nat
>> FutureWarning: In the future, 'NAT == x' and 'x == NAT' will always be False.
np.isnan(nat)
>> TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
如何检查datetime64是否为NaT?我好像从文档里找不出什么东西来。我知道Pandas可以做到这一点,但我不想为这么简单的东西添加依赖。
https://stackoverflow.com/questions/38509538
复制相似问题