# Imports the functionality that we need to display YouTube videos in a Jupyter Notebook.  
# You need to run this cell before you run ANY of the YouTube videos.

from IPython.display import YouTubeVideo  

# Display a specific YouTube video, with a given width and height.  
# WE STRONGLY RECOMMEND that you can watch the video in full-screen mode
# (much higher resolution) by clicking the little box in the bottom-right 
# corner of the video.

YouTubeVideo("chBLLNBGoEE",width=640,height=360)  # modules and pyplot

"""
Explanation: Day 4 pre-class assignment
Goals for today's pre-class assignment

Use the pyplot module to make a figure
Use the NumPy module to manipulate arrays of data

Assignment instructions
Watch the videos below, do the readings linked to below the videos, and complete the assigned programming problems.  Please get started early, and come to office hours if you have any questions!
Recall that to make notebook cells that have Python code in them do something, hold down the 'shift' key and then press the 'enter' key (you'll have to do this to get the YouTube videos to run).  To edit a cell (to add answers, for example) you double-click on the cell, add your text, and then enter it by holding down 'shift' and pressing 'enter'
This assignment is due by 11:59 p.m. the day before class, and should be uploaded into the "Pre-class assignments" dropbox folder for Day 4.  Submission instructions can be found at the end of the notebook.
Some possibly useful links
IPython tutorial -- this contains some very useful suggestions about IPython commands that allow you to get help on Python, figure out what specific variables or objects do, and many other things.
Jupyter notebook tips and tricks -- some clever things you can do with Jupyter notebooks
Another Jupyter notebook tip page
End of explanation
"""


# imports the pyplot module from matplotlib
import matplotlib.pyplot as plt    

# ensures that the plots made by matplotlib/pyplot show up in the notebook!
%matplotlib inline                 

x1 = [2,4,6,8,10,12,14,16,18]
y1 = [10,8.25,7.5,7,6.5,7,7.5,8.25,10]

x2 = [5, 15]
y2 = [15, 15]

# put your plotting commands here!

# Display a specific YouTube video, with a given width and height.  
# WE STRONGLY RECOMMEND that you can watch the video in full-screen mode
# (much higher resolution) by clicking the little box in the bottom-right 
# corner of the video.

YouTubeVideo("BTXyE3KLIOs",width=640,height=360)  # numpy

"""
Explanation: Useful references:

The Python math module - contains a list of math commands
The matplotlib website - where you can find all information about the matplotlib package
The matplotlib gallery - lots of cool visualizations that can be made with matplotlib
The Pyplot tutorial - the pyplot tutorial.  A good place to get started.
A summary of pyplot commands - more extensive documentation on pyplot.

Question 1: The cell below contains four lists of data, which correspond to two sets of X and Y values.  Use matplotlib to make a plot of these datasets.  The first pair of lists (x1, y1) should be drawn with a thick blue dashed line and the second pair of lists (x2, y2) should be drawn with red diamonds.  Make the width and height of the plot a bit wider than the region occupied by the points, so that you can see the shape that is drawn. Add axis labels to the x and y axes, with whatever text you like.  Use the Pyplot Tutorial for inspiration, and in particular you can find instructions on how to create different types of characters and line types in the pyplot 'plot' command documentation.
End of explanation
"""


# put your code here!


"""
Explanation: Useful references

The NumPy Quick Start Guide
An introduction to numpy

Question 2: In the cell below, import the numpy module and then create two arrays with the same number of elements in each one (pick the number of elements and the value of each yourself, making sure they're numbers and not strings!).  Then, add those arrays together and store it in a third array, and print it out.  Sort the values of the third array, and print that out again.
End of explanation
"""


