from wmfdata import mariadb, utils
import pandas as pd
pd.set_option('display.max_colwidth', None)
pd.set_option('display.width', None)
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
wikis = utils.get_dblist('growthexperiments')
dfs = []
for wiki in wikis:
dfs.append(mariadb.run('''
WITH mentees_by_mentor AS (
SELECT gemm_mentor_id AS mentor_id, COUNT(*) AS mentees
FROM growthexperiments_mentor_mentee
WHERE
gemm_mentor_role='primary'
GROUP BY gemm_mentor_id
)
SELECT
DATABASE() AS dbname,
MAX(mentees) AS max_mentees,
AVG(mentees) AS avg_mentees
FROM mentees_by_mentor
''', wiki, use_x1=True))
df = pd.concat(dfs)
df.loc[df.max_mentees.notna()].sort_values(by='max_mentees', ascending=False)
dbname | max_mentees | avg_mentees | |
---|---|---|---|
0 | enwiki | 35204 | 12909.9259 |
0 | fawiki | 23743 | 8007.0909 |
0 | arwiki | 23339 | 9251.2414 |
0 | viwiki | 8183 | 1452.0820 |
0 | frwiki | 6624 | 2979.0533 |
0 | ptwiki | 5795 | 3583.7949 |
0 | idwiki | 5581 | 3411.6000 |
0 | ruwiki | 5320 | 2770.5192 |
0 | kowiki | 5121 | 818.3548 |
0 | trwiki | 4846 | 2598.1481 |
0 | huwiki | 2565 | 1978.1111 |
0 | cswiki | 2478 | 1202.2500 |
0 | plwiki | 2409 | 1612.8000 |
0 | dewiki | 1868 | 1121.4737 |
0 | nlwiki | 1696 | 1128.4286 |
0 | bnwiki | 1529 | 847.5263 |
0 | svwiki | 1384 | 1096.0000 |
0 | rowiki | 1316 | 1046.2857 |
0 | skwiki | 1166 | 1166.0000 |
0 | elwiki | 1119 | 1115.3333 |
0 | hewiki | 848 | 409.1639 |
0 | itwiki | 703 | 418.1538 |
0 | euwiki | 677 | 641.6667 |
0 | hrwiki | 644 | 474.7500 |
0 | srwiki | 633 | 534.7333 |
0 | hywiki | 602 | 410.0000 |
0 | ukwiki | 512 | 380.3827 |
0 | frwiktionary | 486 | 402.7778 |
0 | nowiki | 311 | 238.4000 |
0 | azwiki | 265 | 212.7778 |
0 | tewiki | 126 | 83.1667 |
0 | testwiki | 111 | 23.2581 |
0 | sqwiki | 82 | 68.3333 |
0 | ckbwiki | 28 | 17.0000 |
0 | kuwiki | 18 | 14.3333 |
0 | frrwiki | 3 | 3.0000 |
0 | kswiki | 2 | 2.0000 |