<jupyter_start><jupyter_text>Global Publication By Year<jupyter_code>records.sort_values('pub_year').groupby('pub_year').count()['control_number'].plot()
# records[records.pub_year < 1900].sort_values('pub_year').groupby('pub_year').count()['control_number'].plot()
# records[records.pub_year > 1900].sort_values('pub_year').groupby('pub_year').count()['control_number'].plot()
top_slugs = records.groupby('slug').count()['control_number'].sort_values(inplace=False, ascending=False).ix[:10].index
top_slugs
top_producers = records[records.slug.isin(top_slugs)]
group_top_producers = top_producers.sort_values('pub_year').groupby(['slug', 'pub_year']).count()['control_number']
top_producer_df = pd.DataFrame({
    'madrid,spain': group_top_producers.ix['madrid,spain'],
    'barcelona,spain': group_top_producers.ix['barcelona,spain'],
    'mexico,mexico': group_top_producers.ix['mexico,mexico'],
    'buenos aires,argentina': group_top_producers.ix['buenos aires,argentina'],
    'santiago,chile': group_top_producers.ix['santiago,chile'],
    'rio de janeiro,brazil': group_top_producers.ix['rio de janeiro,brazil'],
    'sao paulo,brazil': group_top_producers.ix['sao paulo,brazil'],
    'bogota,colombia': group_top_producers.ix['bogota,colombia'],
    'lisbon,portugal': group_top_producers.ix['lisbon,portugal'],
    'caracas,venezuela': group_top_producers.ix['caracas,venezuela'],
})
top_producer_df.plot()<jupyter_output><empty_output><jupyter_text>Same but with % of total<jupyter_code>counted_by_year = records.sort_values('pub_year').groupby('pub_year').count()['control_number']
top_producer_df_percent = pd.DataFrame({
    'madrid,spain': group_top_producers.ix['madrid,spain'].divide(counted_by_year.values),
    'barcelona,spain': group_top_producers.ix['barcelona,spain'].divide(counted_by_year.values),
    'mexico,mexico': group_top_producers.ix['mexico,mexico'].divide(counted_by_year.values),
    'buenos aires,argentina': group_top_producers.ix['buenos aires,argentina'].divide(counted_by_year.values),
    'santiago,chile': group_top_producers.ix['santiago,chile'].divide(counted_by_year.values),
    'rio de janeiro,brazil': group_top_producers.ix['rio de janeiro,brazil'].divide(counted_by_year.values),
    'sao paulo,brazil': group_top_producers.ix['sao paulo,brazil'].divide(counted_by_year.values),
    'bogota,colombia': group_top_producers.ix['bogota,colombia'].divide(counted_by_year.values),
    'lisbon,portugal': group_top_producers.ix['lisbon,portugal'].divide(counted_by_year.values),
    'caracas,venezuela': group_top_producers.ix['caracas,venezuela'].divide(counted_by_year.values),
})
top_producer_df_percent.plot()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16331845238095238, 'fraction_numerical': 0.003720238095238095, 'mean_word_length': 9.84274193548387, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '106676', 'license': 'MIT', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1029, 'n_words': 84, 'path': 'processing/final_analysis/21st_century_geotemporal_analysis.ipynb', 'repo_name': 'davebshow/ten_million_books', 'size': '2688'}