Page MenuHomePhabricator
Paste P71214

(An Untitled Masterwork)
ActivePublic

Authored by Urbanecm_WMF on Wed, Nov 27, 12:03 PM.
Tags
None
Referenced Files
F57753037: raw-paste-data.txt
Wed, Nov 27, 12:03 PM
Subscribers
None
from wmfdata import mariadb, utils
import pandas as pd
import warnings
with warnings.catch_warnings():
warnings.simplefilter('ignore')
dfs = []
for wiki in utils.get_dblist('growthexperiments'):
dfs.append(mariadb.run('''
SELECT DATABASE() AS wiki, up_value, COUNT(*)
FROM user_properties
WHERE
up_property = 'growthexperiments-homepage-variant'
GROUP BY up_value
''', wiki))
df = pd.concat(dfs)
print(utils.df_to_remarkup(df, index=False))