Considering the below example in df I have ts
as datetime.
df.dtypes
parts_produced int64
event object
c object
ts datetime64[ns]
dtype: object
Now, I am trying to check if ts is empty because it is when I do a
shift(-1)
on a columnts
for the last record.
If I check np.isnat(ts)
, I get :
TypeError: ufunc 'isnat' is only defined for datetime and timedelta.
Debugging step:
p ts
Timestamp('2020-09-10 00:10:00')
np.isnat(ts)
*** TypeError: ufunc 'isnat' is only defined for datetime and timedelta.