Python by Pat

Python is a wonderful language that is useful for many applications from strictly computer science and data proccesing to physics research, as we will see today. This notebook provides a short outline of the topics I hope to cover today.

What is Python and how the heck do I use it

We will cover the basics of how Python works and how the heck you use it!

Variables

These spooky objects will help us store information. We will learn to control them to do our bidding.

Operators

These will come in handy when we need to compare two different variables.(A thing we do a lot)

Containers

We will use these like a wall of cubbies organized in various ways to store variables together in a meaningful way.

Logic

This is the meat of most programs. We will learn about how to make the computer make decisions and do things repeatedly.

Functions

Functions allow us to wrap up some task into a nice package and use it over and over with ease.

NumPy

NumPy is an add-on library that allows us more freedom with our containers and gives us extra tools for things like linear algebra.

MatPlotLib

We would like to graph things and represent results visually sometimes. We can do just this with MatPlotLib, another add-on.

SciPy

We are all scientists here. Someone came along and said, "What if we made Python Scientific?" And so was born SciPy and add-on that gives us quite a few data analysis tools, of which we will learn a couple.

iPython(Jupyter) Widgets and Visual Numerical Analysis

What if I just vary $\zeta$ or $\phi$. We will cover creating visualisations and controlling parameters while updating the visualisation.

General Pythonic Methods

What is debugging and how do I do it effectively. (AKA, what in the heck is wrong with my code?) Proper googling. How to begin a program if you aren't sure what to do.


In [16]:
import matplotlib.pyplot as plt
import numpy as np
import IPython.html.widgets as widge
%matplotlib inline
def CoolExample(a, b, c):
    x=np.linspace(-1,1,1000)
    plt.plot(x,a*np.exp(b*x)+np.sinc(c*x**4/3))
widge.interact(CoolExample, a=(1,100,1), b=(-5,5,.1), c=(-24, 24,.1))



In [ ]: