<jupyter_start><jupyter_text>Section 2 of:https://www.udemy.com/deep-learning-prerequisites-the-numpy-stack-in-python/https://deeplearningcourses.com/c/deep-learning-prerequisites-the-numpy-stack-in-python  Line Chart<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 20, 1000)
y = np.sin(x) + 0.2 * x
plt.plot(x, y)
# if you are not in a notebook
plt.plot(x, y)
plt.show()
plt.plot(x, y)
plt.xlabel('input')
plt.ylabel('output')
plt.title('my plot');<jupyter_output><empty_output><jupyter_text>Scatterplot<jupyter_code>X = np.random.randn(100, 2)
plt.scatter(X[:,0], X[:,1]);
X = np.random.randn(200, 2)
X[:50] += 3
Y = np.zeros(200)
Y[:50] = 1
plt.scatter(X[:,0], X[:,1], c=Y);<jupyter_output><empty_output><jupyter_text>Histogram<jupyter_code>X = np.random.randn(10000)
plt.hist(X);
plt.hist(X, bins=50);
X = np.random.random(10000)
plt.hist(X, bins=50);<jupyter_output><empty_output><jupyter_text>Plotting Images<jupyter_code>!wget https://github.com/lazyprogrammer/machine_learning_examples/raw/master/cnn_class/lena.png
from PIL import Image
im = Image.open('lena.png')
type(im)
arr = np.array(im)
arr
arr.shape
plt.imshow(arr);
plt.imshow(im);
gray = arr.mean(axis=2)
gray.shape
plt.imshow(gray);
plt.imshow(gray, cmap='gray');<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18427139552814187, 'fraction_numerical': 0.03546646106399383, 'mean_word_length': 6.680473372781065, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, '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': '538525', 'license': 'MIT', 'n_tokens_mistral': 606, 'n_tokens_neox': 559, 'n_words': 83, 'path': 'Matplotlib_Tutorial.ipynb', 'repo_name': 'adasrinivas1229/NUMPY', 'size': '1297'}