pandas dataframe set datetime index

df['Datetime'] = pd.to_datetime(df['date'] + ' ' + df['time'])
df = df.set_index('Datetime')

Here is what the above code is Doing:
1. We’re reading in the data from the CSV file.
2. We’re setting the date and time columns as the index.
3. We’re converting the date and time columns to datetime objects.
4. We’re setting the index to the datetime column.