def isnat(obj):
 if (obj.dtype.kind not in ('m', 'M')):
  raise ValueError('%s is not a numpy datetime or timedelta')
 return (obj.view(int64_dtype) == iNaT)

def isnat ( obj ) : if ( obj . dtype . kind not in ( 'm' , 'M' ) ) : raise ValueError ( '%s is not a numpy datetime or timedelta' ) return ( obj . view ( int64_dtype ) == iNaT )
check if a value is np .