<jupyter_start><jupyter_text>Notes for this week - Class   - quiz, book chapters 2 and 4   - Vectorized computation vs. Python loops   - Slicing NumPy arrays   - NumPy broadcasting)   - More on plotting<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline<jupyter_output><empty_output><jupyter_text>COMP 3122 - Artificial Intelligence with Python__Week 2__ [github.com/kamrik/ML1](https://github.com/kamrik/ML1) [slido.com/COMP3122](http://slido.com/COMP3122) Most of this lecture will be on the whiteboard and live demos in the terminal  Book sections for this week* 2. Introduction to NumPy* 4. Visualization with Matplotlib   Aggregations - Book section 2.4 - min, max, sum etc.  2D Slicingwhiteboard  Plotting several lines -> broadcasting<jupyter_code>day = np.arange(1, 8)
temp = np.array([12, 10, 15, 27, 32, 30, 20])
humid = np.array([40, 45, 50, 88, 90, 90, 30])
plt.scatter(day, temp)
size=humid*10
plt.scatter(day, temp, s=size, c = list('cmykrgb'))
plt.xlabel('Day')
plt.ylabel('Temperature [deg C]')<jupyter_output><empty_output><jupyter_text>Video [<NAME>'s 200 Countries, 200 Years, 4 Minutes - The Joy of Stats - BBC Four](https://www.youtube.com/watch?v=jbkSRLYSojo)  Histograms  Random distributions and histograms  Figures and Axes  Pandas<jupyter_code>import matplotlib.pyplot as plt
%matplotlib inline
plt.plot(range(10))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11340941512125535, 'fraction_numerical': 0.0449358059914408, 'mean_word_length': 5.31981981981982, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '237359', 'license': 'Apache-2.0', 'n_tokens_mistral': 549, 'n_tokens_neox': 484, 'n_words': 141, 'path': 'ML1/lectures/02_week.ipynb', 'repo_name': 'Mosuswalks/AI-with-Python', 'size': '1408'}