Organization and Packaging of Python Projects

Organization and Packaging of Python Projects

A complex research project often relies and many different programs and software packages to accomplish the research goals. An important part of scientific computing is deciding how to organize and structure the code you use for research. A well-structured project can make you a more efficient and effective researcher. It is also a key component of scientific reproducibility more ...

Map making in Python with Basemap

Basemap Tutorial

This brief tutorial will look at the Basemap toolkit extension for matplotlib. Basemap allows you to create map plots in python. It extends matplotlib's functionality by adding geographical projections and some datasets for plotting coast lines and political boundaries, among other things.

We only have time to cover a few examples here, which I have modified from a few places:

more ...

Intermediate Python III: Xarray for Multidimensional Data

Xarray for multidimensional gridded data

In last week's lecture, we saw how Pandas provided a way to keep track of additional "metadata" surrounding tabular datasets, including "indexes" for each row and labels for each column. These features, together with Pandas' many useful routines for all kinds of data munging and analysis, have made Pandas one of the most popular python packages in the world.

more ...

Intermediate Python II: Pandas for Tabular Data


Pandas is a an open source library providing high-performance, easy-to-use data structures and data analysis tools. Pandas is particularly suited to the analysis of tabular data, i.e. data that can can go into a table. In other words, if you can imagine the data in an Excel spreadsheet, then Pandas is the tool for the job.

more ...

Introduction to Python

Core Python Language

Mostly copied from the official python tutorial

Invoking Python

There are three main ways to use python.

  1. By running a python file, e.g. python
  2. Through an interactive console (python interpreter or ipython shell)
  3. In an interactive iPython notebook

We will be using the iPython notebook.

Python Versions

There are two versions of the python language out there: python 2 and python 3. Python 2 is more common in the wild but is depracated. The community is moving to python 3. As new python learners, you should learn python 3. But it is important to be aware that python 2 exists. It is possible that a package you want to use is only supported in python 2. In general, it is pretty easy to switch between then.

more ...