Python Introduction

Variables

In Python, types of variables are automatically inferred by the interpreter

Math operations

Conditionals

Python cares about whitespace! There are no brackets or end statements

Instead of &&, ||, !, we use 'and', 'or', and 'not'.

Boolean values are written as 'True' and 'False'

Data Structures

Loops

Functions + Classes

Numpy

Numpy is a powerful scientific computing library for Python. It uses C/C++ in the background to speed up computation

Matplotlib

Matplotlib is a library used to visualize data. A useful technique when generating matplotlib plots in a notebook is that we can use the "magic" command %matplotlib inline to have the generated plots automatically shown in a cell; this saves some additional Python code which would be required to show the plots (e.g. plt.show()).

You can also plot multiple items in one graph

Seaborn

Seaborn is another libary that can be used to visualize data which is based on matplotlib. Seaborn provides a high-level interface for drawing attrative and informative statistical graphs.

Lets plot the same functions as above but using seaborn instead.

Shell commands in IPython notebooks

IPython notebooks support the use of shell commands directly in a notebook; simply prepend the command with ! and the IPython kernel will execute the code from the shell, not the Python interpreter.