swdata/calc_participants.py
2018-07-15 12:22:05 +08:00

27 lines
752 B
Python

# from G254
import json
from pathlib import Path
from island.match import Match
from island.matches import Matches
result = 0
count = 0
# ms = Matches.from_profile('CCCN')
ms = Matches.from_profile_expr(lambda r: True)
for m in ms.data:
result += len(m.query('player', 'join').where(lambda x: 'bot' not in x or x['bot'] == False).select('pid').raw_data)
count += 1
print(result)
print("participants: %d, matches: %d, avg: %f" % (result, count, result / count))
# 146 users
# casual: 324
# new(254-354, 全国复杂网络大会): 205
# new-2(375-421, 无交流): 320
# new-3(426-440, 有交流): 203
# new-4(443-472, 经典模式,无交流): 230
# new-5(474-,经典模式,有交流): 286
# total: 1244, 81, 15.35
# lab: 1039, 69, 15.05