A workshop offered through the Spring 2026 Quantitative Methods Workshop Series
|
Gavin Klorfine (@gklorfine) Graduate Student Department of Psychology York University, Canada gklorfin@yorku.ca |
Deborah Laze (@bora-laze) Graduate Student Department of Psychology York University, Canada laze@yorku.ca |
Attendees are encouraged to read this entire document, as relevant information and resources are interspersed throughout. We also encourage attendees to look over the slides after each day, due to the large amount of material covered.
This workshop took place June 26, 27, and 28 from 11:30AM to 2:30PM (EDT) over Zoom (the link was provided to attendees over email). Tickets for this workshop were sold out (26/25 spots filled)!
After the third session, a link to a feedback form was emailed to attendees (please fill this out!).
Starting with the installation of Python and relevant packages, this workshop guides attendees through basic programming structures/syntax, culminating in the manipulation and analysis of data. Interactive exercises will be available throughout the workshop to practice applying Python and data analysis skills and will serve as the building blocks for a short project. A digital credential is provided upon the successful completion of this project. This workshop is meant for those with no prior experience or exposure to Python (or programming, for that matter), although all levels are welcome.
Slides were made using the beamer format in Quarto, an open-source publishing system. You may see the 'behind the scenes' code for the slides by opening the .qmd files (either through Visual Studio (VS) Code or online via GitHub). This is also a good way to access the code displayed on each slide (tip: CTRL + F or CMD + F to search is useful here).
The slides (in both .pdf and .qmd format) can be accessed through the below table:
| Day | Content | Slides |
|---|---|---|
| 1 | Foundations (Python Basics) | [.pdf], [.qmd] |
| 2 | Extensions (NumPy and pandas) | [.pdf], [.qmd] |
| 3 | Applications (matplotlib.pyplot and statsmodels) | [.pdf], [.qmd] |
The short project can be accessed through the project/ folder. You may also click here: itp-project.ipynb. All instructions are contained within.
Optional exercises for each day's content (along with solutions) can be found in the optional-exercises/ folder. It is recommended that you take a look at these, as a lot of learning how to program is just practice. If we have time at the end of a given session, we can go over some of these exercises together.
During the workshop sessions, attendees asked some important questions. Questions that were particularly insightful and/or beyond the scope of this workshop are included (and answered) in the q-and-a/ folder as Jupyter Notebooks (separated by day).
You will also find other folders and files in this repository. These are not of primary concern, so I (GK) have provided information in a separate document for those that are curious (extras/repo-structure.md).
Once you have been "shown the ropes" (i.e., after this workshop!) developer documentation will be your best friend. It is essentially an instruction manual provided by developers on how to use their software (so there is a Python one, one for each package, for VS Code, Anaconda, etc.).
- "How To Use Developer Documentation" by Codecademy (YouTube video)
| Resource | Link |
|---|---|
| Package | |
| matplotlib | matplotlib.org/stable |
| NumPy | numpy.org |
| pandas | pandas.pydata.org/docs |
| statsmodels | statsmodels.org/stable |
| Software | |
| Python | docs.python.org |
| Anaconda | docs.conda.io |
| VS Code | code.visualstudio.com/docs/introvideos/basics |
Though not covered in this workshop, AI tools can be very handy for programming. When using these tools, a few general guidelines include:
- Manually verifying that the code generated outputs what is expected (how exactly this is done varies case-by-case)
- This is of the utmost importance when working with real data
- Understand what is generated. This may require reading documentation, watching videos, having the AI tool explain itself (using AI as a 'tutor'), etc.
- Again, if the latter is chosen, be skeptical of the generated information
- Treating confidential information with the necessary care
Common uses for AI include:
- Debugging code (e.g., "Why won't this run?")
- Searching through documentation
- Having it point you in the right direction (e.g., "How do I do
$x$ in Python?")
Starting out, most problems encountered will be basic enough to handle through the familiar 'chat' interface. When problems span multiple files, tools such as ChatGPT Codex and Claude Code are very useful. At the user's command, these tools are given access to the project directory and have the ability to modify code and create/remove files; however, many features are pay-walled (in the case of Claude Code, the entire thing is). Both ChatGPT Codex and Claude Code may be integrated into VS Code as an 'extension'.
Although we cover a vast amount of material in this workshop, we only skim the surface of what Python has to offer. This said, we hope that this workshop enables you to feel comfortable seeking out and engaging with material beyond what we have taught. Some resources to do so are provided below:
-
Sometimes, packages that you might want to install are not available through the Anaconda Navigator. I have included a guide as to how to install these in
extras/pip-install.md -
Including the above bullet (on
pip install), it is often helpful and/or necessary to use the terminal (or command prompt / PowerShell on Windows). A few resources on this include:- Master the basics of Conda environments in Python by E.M. Ratamero from The Jackson Laboratory (YouTube video)
- Absolute BEGINNER Guide to the Mac OS Terminal by Percy Grunwald from TopTechSkills (YouTube video)
- Windows PowerShell [01] Introduction by John Hammond (YouTube video)
-
f-string cheat sheet (see day 1 slides for an initial introduction): Python f-string tips and cheat sheets by Trey Hunner (link)
-
Dictionaries were not explicitly touched upon in this workshop (though they will look familiar from the pandas section). These are variable types that contain "key-value" pairs, with values corresponding to their given key. A good resource on Python dictionaries is Python dictionaries are easy 📙 by Bro Code (YouTube video)
-
List comprehensions are useful, compact ways of making lists in Python. You may find the Learn Python LIST COMPREHENSIONS in 10 minutes! 📃 video by Bro Code helpful (YouTube video)
-
Object-oriented programming (OOP) and the use of classes in Python allow you to bundle related data and functionality. For example, a pandas
DataFrameis a class that bundles both information on the data used (e.g., variable names, cell frequencies) together with functionality (e.g.,DataFrame.describe()to get descriptive statistics). A good resource here is Python Object Oriented Programming Full Course 🐍 by Bro Code (YouTube video)
For more on the packages we covered in this workshop:
| Package | Video |
|---|---|
| numpy | NumPy Tutorial: For Physicists, Engineers, and Mathematicians by Mr. P Solver (YouTube) |
| pandas | Complete Python Pandas Data Science Tutorial! (2025 Updated Edition) by Keith Galli (YouTube) |
| matplotlib.pyplot | Learn Matplotlib in 30 Minutes - Python Matplotlib Tutorial by Tech with Tim (YouTube) |
| statsmodels | statsmodels by Data Science for Everyone (YouTube) |
-
Data Science Essentials with Python (pandas & matplotlib) from Cisco Networking Academy is an online course that provides interactive exercises as well as additional datasets that you can use to independently practice your Python skills
-
Git/GitHub offer a way to share your code and collaborate with others. You are reading a shared document on GitHub right now! A good beginner resource on using Git/GitHub is Learn Git and GitHub in 1 Hour! by Alex the Analyst (YouTube video)
- If this interests you, I (GK) recommend learning how to use the terminal as well (or command prompt / PowerShell on Windows; see above for resources)
-
PsychoPy can be useful for desigining psychological/visual experiments (installing this as a package is finnicky; it is best used as a standalone development environment)
Last, it should be noted that practice is key to learning any of this material. A rule of thumb is to spend two-thirds of your time learning through coding and the remaining third of your time learning through other methods (e.g., watching videos). If you are struggling to find or come up with exercises, I (GK) recommend asking an AI tool to generate some for you.
- The logo for this workshop was created using matplotlib. The script is located in this repo at
images/logo.py. There are a couple of video resources included as comments within this script--I (GK) referred to these videos when making the logo and thought they might be of use to some - pygame-ce for games
- See Introduction to Python for Data Analysis: The Game under
extras/fun/
- See Introduction to Python for Data Analysis: The Game under
from pyfiglet import Figlet
f = Figlet(font = 'slant')
print(f.renderText("Thank you\n for\nattending!")) ________ __
/_ __/ /_ ____ _____ / /__ __ ______ __ __
/ / / __ \/ __ `/ __ \/ //_/ / / / / __ \/ / / /
/ / / / / / /_/ / / / / ,< / /_/ / /_/ / /_/ /
/_/ /_/ /_/\__,_/_/ /_/_/|_| \__, /\____/\__,_/
/____/
____
/ __/___ _____
/ /_/ __ \/ ___/
/ __/ /_/ / /
/_/ \____/_/
__ __ ___ __
____ _/ /_/ /____ ____ ____/ (_)___ ____ _/ /
/ __ `/ __/ __/ _ \/ __ \/ __ / / __ \/ __ `/ /
/ /_/ / /_/ /_/ __/ / / / /_/ / / / / / /_/ /_/
\__,_/\__/\__/\___/_/ /_/\__,_/_/_/ /_/\__, (_)
/____/
