<jupyter_start><jupyter_text>DE Law CountIn this notebook, we count the number of laws in the German corpus that have a certain minimum length in tokens over time.The resulting statistics are reported in the text of the paper.  Preparations<jupyter_code>import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt 
import seaborn as sns
sns.set_style('darkgrid')
plt.rcParams['figure.figsize'] = (9,6)<jupyter_output><empty_output><jupyter_text>Statistics computation and plotting<jupyter_code>years = range(1994, 2018+1)
Gs = [
    nx.read_gpickle(f'../../legal-networks-data/de/4_crossreference_graph/seqitems/{year}-01-01.gpickle.gz')
    for year in years
]
documents_chars_n_years = [
    [d['chars_n'] for n, d in G.nodes(data=True) if d.get('type') == 'document' ]
    for G in Gs
]
df = pd.DataFrame({
    'Year': years,
    **{
        f'> {lim} chars': [
            len([x for x in documents_chars_n if x >= lim]) for documents_chars_n in documents_chars_n_years
        ]
        for lim in range(0, 10000+1, 500)
    }
})
df.set_index('Year').plot()
plt.legend(loc='center left', bbox_to_anchor=(1.0, 0.5))
plt.xticks(range(1994,2019),rotation=45)
plt.tight_layout()
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1272430668841762, 'fraction_numerical': 0.03262642740619902, 'mean_word_length': 4.381578947368421, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '614699', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 474, 'n_tokens_neox': 432, 'n_words': 112, 'path': 'notebooks/si_01_de_law_count.ipynb', 'repo_name': 'QuantLaw/Complex-Societies-and-Growth', 'size': '1226'}