<jupyter_start><jupyter_text>Strings<jupyter_code>results_io = benchmark(formats,
              data_size=100000,
              n_num=15,
              n_cat=15,
              n_rounds=1,
              as_category=False)
avg = results_io.groupby('format').mean().reset_index().drop(columns=['run_no'])
avg
io_speed = avg[~avg['format'].isin([])][['format', 'save_time', 'load_time']].melt(id_vars='format')
ax = sns.barplot(x='format', y='value', hue='variable', data=io_speed, palette="magma")
_ = ax.set_xlabel('File Format')
_ = ax.set_ylabel('Seconds')
_ = ax.set_title('Time to Save/Load a Data Frame')
ax.grid(True)
mem_size = avg[~avg['format'].isin([])][['format', 'save_ram_peak_mb', 'load_ram_peak_mb']].melt(id_vars='format')
ax = sns.barplot(x='format', y='value', hue='variable', data=mem_size, palette="magma")
_ = ax.set_xlabel('File Format')
_ = ax.set_ylabel('Memory, Mb')
ax.set_title('Memory Peaks Consumption Growth When Saving/Loading')
ax.grid(True)
ax = sns.barplot(x='format', y='size_mb', data=avg, palette="magma")
_ = ax.set_ylabel('Memory, Mb')
_ = ax.set_xlabel('File Format')
_ = ax.set_title('Serialized File Size')<jupyter_output><empty_output><jupyter_text>Categorias<jupyter_code>results_io_cat = benchmark(formats,
              data_size=100000,
              n_num=15,
              n_cat=15,
              n_rounds=1,
              as_category=True)
avg = results_io_cat.groupby('format').mean().reset_index().drop(columns=['run_no'])
avg
io_speed = avg[~avg['format'].isin(['json','csv'])][['format', 'save_time', 'load_time']].melt(id_vars='format')
ax = sns.barplot(x='format', y='value', hue='variable', data=io_speed, palette="magma")
_ = ax.set_xlabel('File Format')
_ = ax.set_ylabel('Seconds')
_ = ax.set_title('Time to Save/Load a Data Frame\n(categories)')
ax.grid(True)
mem_size = avg[~avg['format'].isin(['json','csv'])][['format', 'save_ram_peak_mb', 'load_ram_peak_mb']].melt(id_vars='format')
ax = sns.barplot(x='format', y='value', hue='variable', data=mem_size, palette="magma")
_ = ax.set_xlabel('File Format')
_ = ax.set_ylabel('Memory, Mb')
ax.set_title('Memory Consumption Growth When Saving/Loading\n(categories)')
ax.grid(True)
ax = sns.barplot(x='format', y='size_mb', data=avg, palette="magma")
_ = ax.set_ylabel('Memory, Mb')
_ = ax.set_xlabel('File Format')
_ = ax.set_title('Serialized File Size\n(categories)')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19567926879933528, 'fraction_numerical': 0.009140008309098464, 'mean_word_length': 5.670360110803324, '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': '542048', 'license': 'MIT', 'n_tokens_mistral': 938, 'n_tokens_neox': 894, 'n_words': 124, 'path': 'NoteBooks/Curso de Análisis de datos/Analisis y manipulación de datos/Manejando_data/Save Load formats.ipynb', 'repo_name': 'Alejandro-sin/Learning_Notebooks', 'size': '2407'}