import pandas as pd

df = pd.read_excel('result.xlsx')
row_count = len(df)

counts = df.iloc[:, 4:22].apply(pd.value_counts).fillna(0).loc['👍']
users = {}

with open('result.txt', encoding='utf-8') as f:
    idx = 0
    username = ''
    for line in f:
        if line.startswith('玩家：'):
            username = line.strip().split(' ')[1]
            users[username] = dict(vote=0, bonus=0.0)
        if line.startswith('在第') and line.strip().endswith('场比赛中获胜'):
            print(df.columns[idx+4])
            users[username]['vote'] += counts[idx]
            idx += 1

print(row_count)

for k, v in users.items():
    users[k]['bonus'] = f"{v['vote'] / counts.sum() * 1000:.2f}"

print(users)