<jupyter_start><jupyter_text>01 Numpy$\newcommand{\Set}[1]{\{1\}}$ $\newcommand{\Tuple}[1]{\langle1\rangle}$ $\newcommand{\v}[1]{\pmb{1}}$ $\newcommand{\cv}[1]{\begin{bmatrix}1\end{bmatrix}}$ $\newcommand{\rv}[1]{[1]}$ $\DeclareMathOperator{\argmax}{arg\,max}$ $\DeclareMathOperator{\argmin}{arg\,min}$ $\DeclareMathOperator{\dist}{dist}$$\DeclareMathOperator{\abs}{abs}$ Preliminaries    One of my first code cells always looks like this:<jupyter_code>%load_ext autoreload
%autoreload 2
%matplotlib inline<jupyter_output>The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload<jupyter_text>The first two lines mean that modules get reloaded before executing anything. So if I have my own module    and I change it in an editor, then I can run the code without worrying about how to reload the changed    module: it's done automatically.    The third line says that when we draw graphs, they will appear in the notebook itself, not in a separate    window.<!--    My next cell contains some dodgy stuff to suppress some irritating warning messages.import warningsfrom sklearn.exceptions import DataConversionWarningwarnings.filterwarnings(action='ignore', category=DataConversionWarning)warnings.filterwarnings(action='ignore', category=FutureWarning)-->     My next cell usually contains these three imports:<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>My third code cell also contains import statements, ones that are specific to this notebook.     Here's an example:<jupyter_code>from math import sqrt<jupyter_output><empty_output><jupyter_text>So now we can compute square roots:<jupyter_code>sqrt(81)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10571428571428572, 'fraction_numerical': 0.008571428571428572, 'mean_word_length': 6.515021459227468, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '651961', 'license': 'MIT', 'n_tokens_mistral': 508, 'n_tokens_neox': 490, 'n_words': 164, 'path': 'ai1/labs/AI1_01.ipynb', 'repo_name': 'derekgbridge/artificial_intelligence', 'size': '1750'}