<jupyter_start><jupyter_text>Hive<jupyter_code>hive.run?
cawiki_active_eds = hive.run("""
select
    event_user_text
from wmf.mediawiki_history
where
    wiki_db = "cawiki" and
    event_timestamp between "2018-10" and "2018-11" and
    not event_user_is_anonymous and
    event_entity = "revision" and
    event_type = "create" and
    snapshot = "2018-10"
group by event_user_text
""")
cawiki_active_eds.tail()
cawiki_active_eds["event_user_text"].str.len().mean()<jupyter_output><empty_output><jupyter_text>MariaDB<jupyter_code>wikipedias = mariadb.list_wikis("wikipedia")
wikipedias[:5]
wp_articles = mariadb.run("""
select
    database() as wiki,
    ss_good_articles as articles
from site_stats

""", dbs=wiktionaries)
wp_articles.head(10)
n_articles = wp_articles["articles"].sum()
n_articles
print(num_str(n_articles, n_figs=3))
filename = "/home/neilpquinn-wmf/wp_articles.csv"
wp_articles.to_csv(filename, index=False)
hive.load_csv(filename, field_spec="wiki string, articles int", db_name="neilpquinn", table_name="article_counts")
hive.run("select * from neilpquinn.article_counts limit 10")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12433862433862433, 'fraction_numerical': 0.021164021164021163, 'mean_word_length': 7.049645390070922, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '228989', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 462, 'n_tokens_neox': 435, 'n_words': 69, 'path': 'docs/demo.ipynb', 'repo_name': 'milimetric/wmfdata-python', 'size': '1134'}