<jupyter_start><jupyter_text>Global Publication By Year<jupyter_code>records.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[:11].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'],
    'mexico,mexico': group_top_producers.ix['mexico,mexico'],
    'barcelona,spain': group_top_producers.ix['barcelona,spain'],
    'lisbon,portugal': group_top_producers.ix['lisbon,portugal'],
    'santiago,chile': group_top_producers.ix['santiago,chile'],
    'buenos aires,argentina': group_top_producers.ix['buenos aires,argentina'],
    'rio de janeiro,brazil': group_top_producers.ix['rio de janeiro,brazil'], 
    'lima,peru': group_top_producers.ix['lima,peru'],
    'valencia,spain': group_top_producers.ix['valencia,spain'],
    'paris': group_top_producers.ix['paris'],
})
top_producer_df.plot()
counted_by_year = records.sort_values('pub_year').groupby('pub_year').count()['control_number']
top_producer_df_percent = pd.DataFrame({
    'madrid,spain': top_producer_df['madrid,spain'].divide(counted_by_year.values),
    'mexico,mexico': top_producer_df['mexico,mexico'].divide(counted_by_year.values),
    'barcelona,spain': top_producer_df['barcelona,spain'].divide(counted_by_year.values),
    'lisbon,portugal': top_producer_df['lisbon,portugal'].divide(counted_by_year.values),
    'santiago,chile': top_producer_df['santiago,chile'].divide(counted_by_year.values),
#     'buenos aires,argentina': top_producer_df['buenos aires,argentina'].divide(counted_by_year.values),
#     'rio de janeiro,brazil': top_producer_df['rio de janeiro,brazil'].divide(counted_by_year.values), 
#     'lima,peru': top_producer_df['lima,peru'].divide(counted_by_year.values),
#     'valencia,spain': top_producer_df['valencia,spain'].divide(counted_by_year.values),
#     'havana,cuba': top_producer_df['havana,cuba'].divide(counted_by_year.values),
})
top_producer_df_percent.plot.area(stacked=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16483516483516483, 'fraction_numerical': 0.0008791208791208791, 'mean_word_length': 9.345454545454546, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '512784', 'license': 'MIT', 'n_tokens_mistral': 914, 'n_tokens_neox': 881, 'n_words': 73, 'path': 'processing/final_analysis/19th_century_geotemporal_analysis.ipynb', 'repo_name': 'davebshow/ten_million_books', 'size': '2275'}