I have a data pandas dataframe that has two columns. It has a column called 'DateAndTime' (datetime64[ns]) and a column called 'Finished' (Bool). There are some 5000+ rows, all with different date and time, and with the 'Finished' column as True.
What I am trying to do is to group the data into 'shifts' of 7am-7pm and 7pm-7am and sum how many Trues occurred in the 12hr period.
df.head()
DateAndTime Finished
109 2020-07-28 14:36:07.983 True
110 2020-07-28 14:36:34.547 True
111 2020-07-28 14:39:38.187 True
112 2020-07-28 14:41:10.547 True
113 2020-07-28 14:41:32.250 True
df.describe()
DateAndTime Finished
count 5915 5915
unique 5915 2
top 2020-07-29 07:34:25.360000 True
freq 1 5914
first 2020-07-28 14:36:07.983000 NaN
last 2020-08-05 04:57:10.657000 NaN