Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

When: February 4, 2019 (5 - 7 PM)

WherePierceHall 301 (Stephanie F. Connaughton

...

Room)

                  (29 Oxford St, Cambridge, MA 02138)

Presenters: Eleni Kaxiras, Faras Sadek, Keshavamurthy Indireshkumar

Who is this for: This is primarily for classes, but beginning researchers might benefit as well. 

What are the topics: This session will be a simple introduction to Python. We will discuss variables, collections, control of flow, and functions. We will also discuss numpy, scipy, linear algebra and ordinary differential equations.

Pre-tutorial preparation:

We will use Jupyter (formerly Ipython) notebooks. For working with the notebooks,  you have at least two options:
1) You need to have python (with jupyter notebook capability) working on your laptopwork on google colaboratory (needs a google account) or  2) have a working version of python and Jupyter on your laptop.

  1. You can open jupyter notebooks via google colaboratory. You need a google account (g.harvard.edu account will do).
    https://colab.research.google.com/github/farassadek/cee-python-tutorial

  2. Have a local python installation. Easiest way of accomplishing this is via Anaconda distribution of python. 
    Please visit the link below for Anaconda installation (click on download):
    https://www.anaconda.com/what-is-anaconda/
    Suggestions:
    1. Choose Python 3 (3.6 as of this writing)
    2. On Mac, if the graphical installer does not work, choose the command line installer

...

Running Jupyter Notebook:

https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html

2) You can also access jupyter notebook via google collaboratory

Helpful links on Anaconda, ipython notebooks etc:

http://docs.continuum.io/anaconda/faq.html

http://nbviewer.ipython.org/github/catherinedevlin/mpwfw_exercises/blob/master/setup.windows.ipynb

http://opentechschool.github.io/python-data-intro/core/notebook.html

Tutorial Materials 

The rest of this page assumes you have installed Anaconda.

...

Tutorial Materials 

The jupyter notebooks for this tutorial are on github:

https://github.com/farassadek/cee-python-tutorial

You can clone or download this material. (Please note the material is being worked on and will not be in the final form till the day of the

tutorial.) You are not required to have these unless you are trying to follow along. If you download these, put them in the same directory.

On windows, the simplest option is to put these files in the "Ipython Notebooks" directory in the "My Documents" directory under "Documents" (i.e Documents --> My Documents --> IPython Notebooks).

You can open Ipython Notebook on various OSs as follows:

On Mac and LInux, open a terminal (and on Windows, open a command prompt) and change to the directory where your notebooks are. Then type:

jupyter notebook

from the directory where you have all the following files (you need to have Anaconda bin directory in the path). Once the jupyter notebook server and the browser are up, you will see the files with 'ipynb' extension in the dashboard. Clicking on it will open it.

(On windows, there should be an ipython notebook launcher under Anaconda in the Start Menu. However, the better option is to open the notebook as described above.)

python-basics-python3-02012018.ipynb

files-plotting-data-Copy1.ipynb

total_petroleum_consumption_thousand_barrels_per_day.csv

test.py

util.py

custom.css — for changing the appearance of the notebook (optional)