I have two columns in a csv file, one of which has the time in the format hh:mm:ss and the other has the day of week with 1 equal to Monday and 7 equal to Sunday. There is no date associated with the data.
I want to merge the data into one field whereby the time will have a day of the week associated with it.
I have got the time ok with strptime:
time.strptime(fl['journey']['BeginTime'][row], "%H:%M:%S")
Which gives the format:
time.struct_time(tm_year=1900, tm_mon=1, tm_mday=1, tm_hour=23, tm_min=0, tm_sec=0, tm_wday=0, tm_yday=1, tm_isdst=-1)
The digit corresponding to the day of week is stored in the following variable:
fl['journey']['Day'][row]
Any help is appreciated.
1 Answer