If your goal is to indicate where you are missing timestamps, you can convert to datetime and use diff to see the time difference between rows, then use >'00:00:05' to see if the gap is greater than 5 seconds:
>>> pd.to_datetime(df['timestamp']).diff() > '00:00:05'
0 False
1 False
2 False
3 False
4 False
5 False
6 False
7 False
8 True
9 False
10 False
11 False
12 False
13 False
Name: timestamp, dtype: bool
This indicates you are missing records above index 8
If your goal is simply to see whether you are missing timestamps, use any:
>>> (pd.to_datetime(df['timestamp']).diff() > '00:00:05').any()
True
Indicating that you are indeed missing timestamps somewhere
[EDIT] as per @JoranBeasley's suggestion, you can also use the mode of your time differences to infer the desired frequency:
d = pd.to_datetime(df['timestamp']).diff()
>>> (d > d.mode()[0])
0 False
1 False
2 False
3 False
4 False
5 False
6 False
7 False
8 True
9 False
10 False
11 False
12 False
13 False
Name: timestamp, dtype: bool
Because d.mode()[0] will return the most common frequency observed:
>>> d.mode()[0]
Timedelta('0 days 00:00:05')