See the sample panda data below.
ID DT InOut
120 2022-12-22-02:12:123 IN
120 2022-12-23-04:12:456 OUT
120 2022-12-26-08:11:125 IN
120 2022-12-30-02:12:126 OUT
First I need to change my datetime variable to only 2 digits for the second part (ex: 2023-03-03 14:11:43).Then I need to add one second to my datetime variable only for InOut = OUT.
My dt variable is the in datetime64[ns] format. I wasn't able to create dummy data for the datetime variable.
Thanks for any help!
import pandas as pd
df = pd.DataFrame({'ID': [120, 120, 120, 120],
'InOut': ['IN', 'OUT', 'IN', 'OUT']})