I have a dictionary which is made pretty as a matrix:
Dictionary:
{'1': {'3': 0, '2': 1, '5': 1, '4': 0, '6': 29},
'3': {'1': 0, '2': 0, '5': 0, '4': 1, '6': 1},
'2': {'1': 13, '3': 1, '5': 21, '4': 0, '6': 0},
'5': {'1': 39, '3': 0, '2': 1, '4': 0, '6': 14},
'4': {'1': 1, '3': 1, '2': 17, '5': 2, '6': 0},
'6': {'1': 0, '3': 43, '2': 0, '5': 0, '4': 1}}
The information as a matrix:
From the matrix i can see that the column number 4 has the lowest numbers.
I want to write a function findFristFread( overlaps) that takes the dictionary as argument and returns '4' because that is the column with lowest numbers.
How do i get the function to 'understand' that i want the lowest numbers?
Can anybody get me started?
Dictionary:
{'1': {'3': 0, '2': 1, '5': 1, '4': 0, '6': 29},
'3': {'1': 0, '2': 0, '5': 0, '4': 1, '6': 1},
'2': {'1': 13, '3': 1, '5': 21, '4': 0, '6': 0},
'5': {'1': 39, '3': 0, '2': 1, '4': 0, '6': 14},
'4': {'1': 1, '3': 1, '2': 17, '5': 2, '6': 0},
'6': {'1': 0, '3': 43, '2': 0, '5': 0, '4': 1}}
The information as a matrix:
Code:
1 2 3 4 5 6 1 - 1 0 0 1 29 2 13 - 1 0 21 0 3 0 0 - 1 0 1 4 1 17 1 - 2 0 5 39 1 0 0 - 14 6 0 0 43 1 0 -
I want to write a function findFristFread( overlaps) that takes the dictionary as argument and returns '4' because that is the column with lowest numbers.
How do i get the function to 'understand' that i want the lowest numbers?
Can anybody get me started?
Comment