Have been working through options listed in Converting between datetime, Timestamp and datetime64; however, numpy's isnat() seems to not recognize a datetime object, or I'm missing some other kind of datetime object that the function requires for input.
Here's an overview of the dataframe:
>>> time_data.head()
Date Name In AM Out AM \
0 2017-12-04 AUSTIN LEWIS 1900-01-01 07:03:11 1900-01-01 12:01:50
1 2017-12-05 AUSTIN LEWIS 1900-01-01 05:24:07 1900-01-01 12:08:21
2 2017-12-06 AUSTIN LEWIS 1900-01-01 11:58:32 NaT
3 2017-12-07 AUSTIN LEWIS 1900-01-01 08:31:23 1900-01-01 12:49:51
4 2017-12-11 AUSTIN LEWIS 1900-01-01 06:55:21 1900-01-01 12:02:08
In PM Out PM Sick Time
0 1900-01-01 12:28:52 1900-01-01 17:34:53 NaT
1 1900-01-01 12:35:12 1900-01-01 16:15:17 NaT
2 NaT 1900-01-01 23:59:01 NaT
3 1900-01-01 13:18:34 1900-01-01 18:10:35 NaT
4 1900-01-01 12:30:49 1900-01-01 17:39:54 NaT
>>> time_data.dtypes
Date object
Name object
In AM datetime64[ns]
Out AM datetime64[ns]
In PM datetime64[ns]
Out PM datetime64[ns]
Sick Time datetime64[ns]
dtype: object
>>> type(time_data['In AM'][3])
<class 'pandas._libs.tslib.Timestamp'>
>>> type(time_data['In AM'][3].to_datetime())
<type 'datetime.datetime'>
if np.isnat(time_data['Out AM'][row].to_datetime()) & np.isnat(time_data['In PM'][row].to_datetime()):
Throws "ValueError: ufunc 'isnat' is only defined for datetime and timedelta"
What am I missing here?!