Source: https://www.unil.ch/gis/files/live/sites/gis/files/shared/PDF_site/python_notes.pdf