<jupyter_start><jupyter_text>Numpy Benchmarks<jupyter_code>import numpy as np
%run ../init/benchmark.py
register_timeop_magic(get_ipython(), 'numpy')
%%timeop -o create_rand_mat
x = np.random.rand(2000000, 1000)
x.shape, x.dtype<jupyter_output><empty_output><jupyter_text>Axis Sums<jupyter_code>%%timeop -o sum_cols
x.sum(axis=0).shape
%%timeop -o sum_rows
x.sum(axis=1).shape<jupyter_output><empty_output><jupyter_text>Transformed Sums<jupyter_code>%%timeop -o sum_cols_trans
(x < .5).sum(axis=0).shape
%%timeop -o sum_rows_trans
(x < .5).sum(axis=1).shape<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15502555366269166, 'fraction_numerical': 0.028960817717206135, 'mean_word_length': 8.483870967741936, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '103295', 'license': 'Apache-2.0', 'n_tokens_mistral': 264, 'n_tokens_neox': 252, 'n_words': 35, 'path': 'notebooks/benchmark/linalg-numpy.ipynb', 'repo_name': 'tomwhite/gwas-analysis', 'size': '587'}