Используйте to_datetime
с dayfirst=True
, если формат DD/MM/YYYY HH:MM
и тиен фильтр с between
с boolean indexing
:
df['Alarm Time'] = pd.to_datetime(df['Alarm Time'], dayfirst=True)
#change format dates
df = df[df['Alarm Time'].between('2019-02-06 14:38:00','2019-02-06 14:41:00')]
print (df)
Alarm Number Alarm Type Severity Alarm Time \
2 333 Communication Minor 2019-02-06 14:38:00
3 444 Communication Minor 2019-02-06 14:38:00
4 1223 Processing Minor 2019-02-06 14:38:00
5 4343 Processing Minor 2019-02-06 14:39:00
6 414134 Communication Minor 2019-02-06 14:39:00
7 443314 Communication Minor 2019-02-06 14:39:00
8 1343443 Communication Minor 2019-02-06 14:39:00
9 41343434 Processing Minor 2019-02-06 14:41:00
10 343 Communication Minor 2019-02-06 14:41:00
11 343 Communication Minor 2019-02-06 14:41:00
12 34343 Communication Minor 2019-02-06 14:41:00
Probable Cause
2 Communication Subsystem Failure
3 Communication Subsystem Failure
4 Application Subsystem Failure
5 Application Subsystem Failure
6 Communication Subsystem Failure
7 Communication Subsystem Failure
8 Communication Subsystem Failure
9 Application Subsystem Failure
10 Communication Subsystem Failure
11 Communication Subsystem Failure
12 Communication Subsystem Failure