<jupyter_start><jupyter_text>Build Reports for Contributors from USFD Suggestion Analysis Create prototype reportsCreate contributor-specic reports of suggestions that may be distributed.<jupyter_code>import datetime
import os


import pandas
# load data
export_df = pandas.read_csv("data/htusfd-suggestions.csv")
sorted_export_df = export_df.sort_values(by=["contributor_code", "contribsys_id"])

if not os.path.exists("reports"):
    os.makedirs("reports")
    
# todo: fix issue with yale missing
# iterate through suggestions, print reports to contrib-based files
contributor_code = ""
file = None
for index, row in sorted_export_df.iterrows():
    if contributor_code != row["contributor_code"]:
        print("Writing reports/{}.txt".format(contributor_code))
        contributor_code = row["contributor_code"]
        if file:
            file.close()
        file = open("reports/{}.txt".format(contributor_code),"w+")
    file.write(row["contribsys_id"] + "\n")
if file:
    file.close()
print("Completed notebook ({}).".format(datetime.datetime.utcnow().isoformat()))<jupyter_output>Completed notebook (2019-09-03T19:04:50.718650).
{'fraction_non_alphanumeric': 0.12532865907099036, 'fraction_numerical': 0.017528483786152498, 'mean_word_length': 5.010526315789473, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '184393', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 371, 'n_tokens_neox': 344, 'n_words': 79, 'path': 'build_reports.ipynb', 'repo_name': 'cdlib/zephir-htusfd-suggestions', 'size': '1141'}