Python is a general purpose programming language with stable and high-performing libraries for numerical computing, data visualization, gridded data, machine learning, and optimization. Python is generally the go-to language for anything we can't do easily in Julia.
You should install Python (version 3.6 or greater -- not version 2) using miniconda.
This provides you with the
conda package manager, which you can use to create Python "environments" on your computer.
Conda is a package manager used to manage dependencies for python projects (and also R and other programs). A key feature of conda is that you can create many different environments, each of which has different sets of packages. Although you can also install packages and create environments using other tools, conda has lots of advantages.
You can learn more about conda in this Chapter in Ryan Abernathey's Earth and Environmental Data Science textbook.
- To start, read the Chapter in Earth and Environmental Data Science
- The Pangeo project maintains a list of educational material for python in the geosciences
- to write better code, watch Raymond Hettinger's 2015 PyCon talk Beyond PEP 8 -- Best practices for beautiful intelligible code
- to understand object oriented programming, type hints, scripting, and
mypywatch Livecoding Madness - Let's Build a Deep Learning Library and I don't like notebooks by Joel Grus
- to learn about unit testing, work through the short course Software Testing and Testing Automation with Python by Leeman Geophysical LLC
While python is a great language, using consistent style and formatting makes it easier for others to work on:
- The black formatter keeps code pretty
- The mypy linter and static type hinting clarify expected inputs and outputs
- Python VS Code extension