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}';
|
render = lambda r: f'{r:g}';
|
||||||
table = pd.DataFrame({
|
table = pd.DataFrame({
|
||||||
'items': items.tolist() + ['----', '∑'],
|
'items': items.tolist() + ['----', '∑'],
|
||||||
'nr': list(map(str, choice)) + ['----', f'{float(sum(choice)):g}'],
|
'nr': list(map(str, choice))
|
||||||
'costs': list(map(render, costs)) + ['----', f'\x1b[92;1m{sum(choice*costs):g}\x1b[0m'],
|
+ ['----', f'\x1b[92;1m{float(sum(choice)):g}\x1b[0m'],
|
||||||
'values': list(map(render, values)) + ['----', f'\x1b[92;1m{sum(choice*values):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(
|
repr = tabulate(
|
||||||
table,
|
table,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user