by
df['timeDiff'] = df['time'].diff()
you will get
df_input
Value time
8970 2020-11-20 15:40:00
7602 2020-11-20 15:50:00
7603 2020-11-20 16:00:00
7604 2020-11-20 16:10:00
7757 2020-11-20 18:30:00
7758 2020-11-20 20:30:00
into :
df_output
Value timeDiff
8970 Na
7602 00:10:00
7603 00:10:00
7604 00:10:00
7757 02:20:00
7758 02:00:00
then you can group them as you need to determine continues. I guess this will help you to solve the problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…