Skip to content

Commit add94e8

Browse files
committed
scoring_algorithm: sometimes we look before we leap.
1 parent c50e703 commit add94e8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

other/scoring_algorithm.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,9 @@ def procentual_proximity(source_data: list[list[float]], weights: list[int]) ->
3939
data_lists: list[list[float]] = []
4040
for data in source_data:
4141
for i, el in enumerate(data):
42-
try:
43-
data_lists[i].append(float(el))
44-
except IndexError:
45-
# generate corresponding number of lists
42+
if len(data_lists) < i + 1:
4643
data_lists.append([])
47-
data_lists[i].append(float(el))
44+
data_lists[i].append(float(el))
4845

4946
score_lists: list[list[float]] = []
5047
# calculating each score

0 commit comments

Comments
 (0)