jeudi 25 février 2021

Finding if the time is before or after another time with .datetime

so I have a column of data in a dataframe which is time in .datetime, in HH:MM:SS. I just want to check if the time is in the first or the second shift, I have this code shown at the end but I keep getting the error:

TypeError: 'DataFrame' object is not callable

Anyone got any ideas? Thanks in advance!

if df_data_time(df_data_time['Time']).between('00:00:00','11:59:59') == True:
    df_data_time['Time'] = 'Shift 1'
if df_data_time(df_data_time['Time']).between('12:00:00','23:59:59') == True:
    df_data_time['Time'] = 'Shift 2'

Aucun commentaire:

Enregistrer un commentaire