master > master: code py - minor
This commit is contained in:
parent
7b2950fc7a
commit
3a937e71d3
@ -67,9 +67,12 @@ def display_rucksack(
|
||||
render = lambda r: f'{r:g}';
|
||||
table = pd.DataFrame({
|
||||
'items': items.tolist() + ['----', '∑'],
|
||||
'nr': list(map(str, choice)) + ['----', f'{float(sum(choice)):g}'],
|
||||
'costs': list(map(render, costs)) + ['----', f'\x1b[92;1m{sum(choice*costs):g}\x1b[0m'],
|
||||
'values': list(map(render, values)) + ['----', f'\x1b[92;1m{sum(choice*values):g}\x1b[0m'],
|
||||
'nr': list(map(str, choice))
|
||||
+ ['----', f'\x1b[92;1m{float(sum(choice)):g}\x1b[0m'],
|
||||
'costs': list(map(render, costs))
|
||||
+ ['----', f'\x1b[92;1m{sum(choice*costs):g}\x1b[0m'],
|
||||
'values': list(map(render, values))
|
||||
+ ['----', f'\x1b[92;1m{sum(choice*values):g}\x1b[0m'],
|
||||
});
|
||||
repr = tabulate(
|
||||
table,
|
||||
|
Loading…
x
Reference in New Issue
Block a user