My overall goal is to full the hour from each data point to list each beginning time. To do this, I know I need to clean my data so that it is all in a consistent format. I have been trying to use to_datetime and df[time].dt.hour to pull the data needed, but it does not work as the formatting is inconsistent.
This is the data I am working with:
| Work Hours |
|---|
| 08:15 AM-03:15PM |
| M,T,W,Th: 7:45AM-3:05PM F:7:45AM-2:07PM |
| 7:45am-3:00pm |
| 7:45AM.-2:15 PM |
My current code: df['Work Hours']_dt = pd.to_datetime(df)
I also tried: df['Starting Time'] = df['Work Hours'].dt.hour
My primary concern is to clean the data firstly and eventually I want to extract only the starting time from each workplace so that it looks something like this:
| Starting Time |
|---|
| 8 |
| 7 |
| 9 |
| 7 |