Python is a high-level, interpreted programming language that has now become the language of choice in many fields of science. This is largely due to its ease of programming and readability, the large number of libraries and community support, and the variety of programming environments (e.g. command line interpreters, scripts, web-based interpreters, notebooks). This tutorial, which is largely based on Corey Schafer’s excellent YouTube series, is a crash course in Python designed to give you an overview of the programming essentials, as well as some useful tools for scientific computing, data processing, and visualization.
The majority of the modules in this tutorial are written in Jupyter Notebooks (formally IPython Notebooks). This is a web-based interactive development environment (IDE) for writing code (e.g., Python, Markdown, LATEX, etc.) and displaying graphics. It uses a notebook format similar to Wolfram Mathematica or Windows OneNote, where interactive cells of code can be executed one at a time by a kernel (a centralized “computational engine”). While the kernel is running, all the data generated by your code is stored temporarily in your computer’s random access memory; allowing you to access data generated in previous cells.
Jupyter Notebooks can be run in a web browser if you have Python and Jupyter installed locally. However, it is highly recommended to install and use Visual Studio Code (VS Code) to work through this tutorial. This IDE integrates the three most common Python environments (command line, scripts, and notebooks), allowing you to choose the most convenient option. It also has built-in features for debugging and streamlines the installation of third-party extensions for additional features like code linting.