Coding Cheatsheets#

Tip

When you’re working in Python it can be super helpful to regularly refer to these resources. Remember that you can always use any API reference link below to get a comprehensive list of all the functions and methods in a library - a bit nicer than only relying on ? in your notebook.

Course Packages#

Throughout the course we’ve been making use of the following Python libraries in case you want to create a reproducible environment for yourself:

Computing Basics#

Coding Notebooks#

  • Python Notebooks in VSCode

  • Python Notebooks in JupyterLab

  • To show multiple outputs from a single cell add this to the top of your notebook:

    • %config InteractiveShell.ast_node_interactivity = "all"

    • Other options include last, last_expr (default), last_expr_or_assign, none

  • To produce higher-resolution plots add this to the top of your notebook:

    • %config InlineBackend.figure_formats = 'retina'

Conda Environments#

Python Basics#

Numpy - numerical array library#

Matplotlib - basic plotting library#

Scipy - scientific functions and statistics library#

Polars - DataFrame and tidy-data analysis library#

Seaborn - statistical visualization library#

Statsmodels - regression library#

MarginalEffects - like emmeans in R#

Pymer4 - multi-level/linear-mixed-models#