MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / get_data

Function get_data

other/scoring_algorithm.py:27–38  ·  view source on GitHub ↗

>>> get_data([[20, 60, 2012],[23, 90, 2015],[22, 50, 2011]]) [[20.0, 23.0, 22.0], [60.0, 90.0, 50.0], [2012.0, 2015.0, 2011.0]]

(source_data: list[list[float]])

Source from the content-addressed store, hash-verified

25
26
27def get_data(source_data: list[list[float]]) -> list[list[float]]:
28 """
29 >>> get_data([[20, 60, 2012],[23, 90, 2015],[22, 50, 2011]])
30 [[20.0, 23.0, 22.0], [60.0, 90.0, 50.0], [2012.0, 2015.0, 2011.0]]
31 """
32 data_lists: list[list[float]] = []
33 for data in source_data:
34 for i, el in enumerate(data):
35 if len(data_lists) < i + 1:
36 data_lists.append([])
37 data_lists[i].append(float(el))
38 return data_lists
39
40
41def calculate_each_score(

Callers 1

procentual_proximityFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected