I have an excel file with two columns, one is written as 'YYYY/MM/DD' and the other is written as 'HH:MM:SS'. I then combined the two columns to create a 'datetime' column that returns 'YYYY/MM/DD HH:MM:SS' in a string format.
df['datetime'] = df['YYYY/MM/DD'].astype(str) + ' ' + df['HH:MM:SS'].astype(str)
df['datetime'] = pd.to_datetime(df['datetime'])
Now I want to convert datetime to an integer but am having no luck. This is what I have tried to do:
df['wtime'] = int(float(df['datetime']))
I just want an integer value returned so I can eventually get the start and end time of the data set.