<jupyter_start><jupyter_text>[Back to PyCampNextLevel Outline](PyCampNextLevel.ipynb) HOME FROM SCHOOL?Don't let that keep you behind.Lets practice plotting functions to keep in shape!<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline<jupyter_output><empty_output><jupyter_text>[Explain that last command!](https://stackoverflow.com/questions/43027980/purpose-of-matplotlib-inline)<jupyter_code>def parabola(x):
    return x * x
domain = np.linspace(-5,5,100) # a 100 points between [5, -5]
df = pd.DataFrame({"domain":domain, "range":[parabola(n) for n in domain]}) # slower
df.head()<jupyter_output><empty_output><jupyter_text>[DataFrame.plot](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.plot.htmlpandas.DataFrame.plot)<jupyter_code>df.plot(x="domain", y="range", title="PARABOLA");
df = pd.DataFrame({"domain":domain, "range":np.power(domain, 3)})  # faster than before
df.plot(x="domain", y="range", title="3RD POWER", color='orange');
df = pd.DataFrame({"domain":domain, "sine":np.sin(domain), "cosine":np.cos(domain)})
# gca stands for 'get current axis'
ax = plt.gca()

df.plot(kind='line',x='domain',y='sine', color='orange', ax=ax)
df.plot(kind='line',x='domain',y='cosine', color='black', ax=ax)

plt.show();<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17704426106526633, 'fraction_numerical': 0.015003750937734433, 'mean_word_length': 7.8933333333333335, 'pattern_counts': {'":': 7, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '552165', 'license': 'MIT', 'n_tokens_mistral': 517, 'n_tokens_neox': 490, 'n_words': 89, 'path': 'PlotFunctions.ipynb', 'repo_name': 'westurner/python_camp', 'size': '1333'}