我有一个这样的数据框:
df = pd.DataFrame({'origin': ['town a', 'town a', 'town a','town a', 'town c', 'town c'],\
'destination': ['town b', 'town b', 'town b','town b','town b','town b'], \
'departure_hour': ['09:30', '09:45','10:00', '10:30','14:30', '15:30'],\
'arrival_hour': ['11:30', '10:50','12:00', '11:45','16:30', '19:30'],\
'date': ['29-09-2020', '29-09-2020','29-09-2020','29-09-2020','29-09-2020','29-09-2020']})
origin destination departure_hour arrival_hour date
0 town a town b 09:30 11:30 29-09-2020
1 town a town b 09:45 10:50 29-09-2020
2 town a town b 10:00 12:00 29-09-2020
3 town a town b 10:30 11:45 29-09-2020
4 town c town …Run Code Online (Sandbox Code Playgroud)