Week 4: September 19 - 23

Loading Numerical Data from Files

Numerical data often needs to be loaded from a file for further processing and display. We learn how this can be done using NumPy.

Mauna Loa CO2 Data

Carbon dioxide measurements have been made daily at an observatory on the Mauna Loa volcano on Hawaii island since 1958. We obtain, load and plot this data.

Simple Linear Regression

The problem of finding a model which best fits a set of points arises naturally when we study the Mauna Loa CO2 data. We explore what a “good fit” means and how to find one.

Jupyter Notebook

  • IPython “magics”: %timeit and %%timeit

Python

  • More plotting options

NumPy

NumPy is the standard package for numerical computing in Python. It uses a new container for numerical data - the ndarray - that supports fast and efficient computation. NumPy also defines routines for accessing and manipulating these arrays.

  • Array creation
  • Array operations
  • Vectorization
  • Multi-dimensional arrays
  • Array indexing and slicing
  • loadtxt
  • mean

Quiz 3: Markdown and LaTeX

  • Headers
  • Formatting text
  • Mathematical expressions

Sample Quiz 3