I have a dataframe:
col_1
Agent AB 7:00 AM
Agent AB 7:00 AM
Cust XY 8:00 AM
Cust XY 9:00 AM
Agent AB 11:00 AM
I want to split it into 2 columns such that the time gets split into a new column.
Expected Output:
col_1 col_2
Agent AB 7:00 AM
Agent AB 7:00 AM
Cust XY 8:00 AM
Cust XY 9:00 AM
Agent AB 11:00 AM
I researched and found out that this can be done using: string slicing.
Something like:
df['col_2'] = df['col_1'].str[-8:-1]
Is there a better way to do it??