Skip to content

Commit 5cfea1a

Browse files
committed
add capture for typeerror
1 parent cdbfd39 commit 5cfea1a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

get_end_count.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ def group_end(end_d_f, offset=5):
6565

6666
# Iterate through pairs of numbers
6767
for previous, current in zip(previous_sequence, current_sequence):
68-
if abs(previous - current) >= offset:
69-
# Large gap, we create a new empty sublist
70-
groups.append([])
71-
# Keep appending to the last sublist
68+
try:
69+
if abs(previous - current) >= offset:
70+
# Large gap, we create a new empty sublist
71+
groups.append([])
72+
# Keep appending to the last sublist
73+
except TypeError:
74+
pass
7275
groups[-1].append(current)
7376

7477
# print(groups)

0 commit comments

Comments
 (0)