pd combine date time

Solutions on MaxInterview for pd combine date time by the best coders in the world

showing results for - "pd combine date time"
Anthony
04 Sep 2018
1If df.Date and df.Time are of type str:
2pd.to_datetime(df.Date + ' ' + df.Time)
3
4If df.Date and df.Time are of type datetime.date and datetime.time respectively:
5pd.to_datetime(df.Date.astype(str) + ' ' + df.Time.astype(str))