Reduce, Reuse, Recycle Python

This tutorial shows various methods of reusing your Python code. The follow up tutorial on packaging code will explore ways to make code reusable by others.

In [1]:
import numpy as np
import matplotlib.pyplot as plt

Step 0: functions

Functions are the simplest way to cut down duplicated code …

more ...

Many ways to run Python

Unlike other programs that have a single programming interface (matlab) or a dominant interface de jour (R with RStudio), Python has a whole ecosystem of programs for writing it. This can be confusing at first, with so much choice, what should you use for your project?

This presentation will cover …

more ...

Analysis of GitHub commits

To see where we got this dataset from, check out our last notebook on scraping GitHub.

To get plotting, we start by importing the holy trinity of Python

In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

We read in the anaonymised data to …

more ...

Scraping GitHub after a hackweek

A meta-hackweek hack

I put this notebook together after attending the excellent Oceean Hack Week 2020 (OHW) event. You can read my blog post about it here. A key part of the event was creating collaborative projects on GitHub. I wanted to see if attending the hackweek changed participants pattern …

more ...

Making a geographic grid with pyproj

In [1]:
import cartopy
import cartopy.crs as ccrs
import geopy
import matplotlib.pyplot as plt
import numpy as np

The aim of this notebook is to create a spatial grid of uniform spacing from a user defined origin point

Along the way I will introudice some functionality of geopy …

more ...