A Technique

Overview

The Technique format is a tutorial where you want to show people how to use a technique they may not be familiar with or multiple versions of how to do a small task.

For example:

  • Merging two datasets

  • Data cleaning: things to look for and how to fix them

  • Lambda functions and when to use them

  • Python list comprehensions

  • Subsetting a data frame

  • Changing color scales for data visualizations

What are your 3-6 sections?

Here, your 3-6 sections are all variations on the same idea -- you'll be doing essentially the same thing in a few different ways.

Start with the easiest case of what you want to do that shows the syntax or basic template, and build up from there. Consider alternative specifications, additional options, how the technique varies for different types of data or missing data, more complex situations, etc.

A variation on this is to show common missteps or ways people can use this technique incorrectly.

Writing the Exercise Outline

Your first exercise is the easiest/simplest version of the technique. Even if this version isn't very interesting, start with the basics so you can build on it later.

After that, consider how the technique might change in different circumstances, and create an exercise for each circumstance.

  1. If something changed about the data or inputs, do you have to adjust the technique? Or does it change the output? If so, another exercise (or several) can be how you use the technique with slightly different input. Things that could change include: type of data (from integer to decimal, from numeric to categorical or text, etc.) or type of input (scalar, string, list, array, data frame, etc.).

  2. Do you always use the same syntax/function, or are there alternatives that you want to show?

  3. What is the most common way that someone could use the technique incorrectly or make a mistake that will result in an error? Give them an example of such code and have them fix it.

  4. What would a more challenging or complicated use case for this technique be?

  5. Are there any helper functions, optional arguments to functions you might use, or special tips for dealing with challenging cases?

  6. Is there something you were hoping to teach or demonstrate that wasn't covered by the questions above? Great - that can be an exercise too. If it's something you want to cover, then there should be an exercise for it.

Example

List comprehensions in Python (this is a 2 hour workshop when taught in full)

Exercise Outline

  • Select items from a list without list comprehension (then show how that becomes a list comprehension)

  • Make a list of items that are shared (or unique) between two lists

  • Make a list of numbers in a certain range

  • Change all the items in a list in the same way

  • Filter a list by some condition

  • Make a list out of the lines in a file

Last updated