How can I parse the content of this Python DataFrame into a new column that contains the existing columns as one datetime object?
I would like to avoid a for loop (and if possible also a lambda) for time performance reasons.
import pandas as pd
df = pd.DataFrame({"century": [20, 20, 20], "my_date": [180105, 180106, 180107],
"my_time": ["17:01", "17:02", "17:03"]})
.
century my_date my_time
0 20 180105 17:01
1 20 180106 17:02
2 20 180107 17:03