This commit is contained in:
John Gatward
2026-03-19 21:07:16 +00:00
commit a69ef51825
18 changed files with 1000 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
from constants import PLAYER_NAME_COLUMNS
def generate_player_table(df):
header = [["Name", "Appearances", "Spent"]]
player_stats = [
(name, df[name].sum())
for name in df.columns
if name in PLAYER_NAME_COLUMNS
]
player_stats.sort(key=lambda x: x[1], reverse=True)
total = sum(n for name, n in player_stats)
body = [
[name, n, f"£{n * 3:.2f}"]
for name, n in player_stats
]
footer = [["Total", total, f"£{total * 3:.2f}"]]
return (header + body + footer)