I have a data frame that includes the following values:
Date 07/12/17
Start Time 05:00 PM
Each of these is currently stored as strings.
I need to format/concatenate this information to be in the following format:
'2017-07-12 17:00'
I'm new to python and most of the solutions I've found don't apply to pandas data frames.
Example code:
#import pandas
import pandas as pd
#import file
df = pd.read_csv('Registrant List.csv',
index_col='Conf Number', names = ['Conf Number','Email Address',
'Customer ID', 'First Name', 'Last Name', 'Sessions Date',
'Session Time'])
#parse session time
df['Session Start Time'] = df['Session Time'].str.rpartition('-')[0]
print(df.to_string())
Example output:
Conf Number Email Address Customer ID First Name Last Name Sessions Date Session Time Session Start Time
25502163 abc@123.com NaN Justin Anderson 7/11/2017 10:30 AM - 11:00 AM EST 10:30 AM