Sub topic 2
Open coding your observations
This chapter assumes you have raw notes from research sessions, that you can split a note into single observations, and that you can read basic Python. The code examples use only the standard library.
Open coding your observations
Open coding is the first pass where you label each observation with a short code that names what it is about. Let the codes come from the data, and revise them as new patterns appear. Assign one or more codes to each atomic observation, then keep the codes consistent across all notes.
The following script tags four observations and lists which notes share each code.
from collections import defaultdict
observations = [
{"id": "n1", "participant": "P1", "text": "Skipped the setup tour because it felt long.", "codes": ["setup_friction"]},
{"id": "n2", "participant": "P2", "text": "Could not find where to import old data.", "codes": ["setup_friction", "navigation_confusion"]},
{"id": "n3", "participant": "P2", "text": "Asked a coworker how to share a board.", "codes": ["sharing_unclear"]},
{"id": "n4", "participant": "P3", "text": "Gave up looking for the export button.", "codes": ["navigation_confusion"]},
]
by_code = defaultdict(list)
for obs in observations:
for code in obs["codes"]:
by_code[code].append(obs["id"])
for code, ids in sorted(by_code.items()):
print(code, ids)The output is:
navigation_confusion ['n2', 'n4']
setup_friction ['n1', 'n2']
sharing_unclear ['n3']Building and maintaining a codebook
A codebook is a list of codes. Each entry gives a definition, an include rule, an exclude rule, and example note IDs. Different researchers apply codes the same way only when they share these rules.
| Code | Definition | Include when | Exclude when |
|---|---|---|---|
| navigation_confusion | The participant cannot find a feature | They search, backtrack, or ask where something is | They find the feature but dislike it |
| setup_friction | Getting started takes more effort than expected | They skip or struggle with onboarding steps | They finish onboarding without trouble |
> Update the codebook whenever you add, merge, or rename a code. Then recheck earlier observations against the new rule.
The affinity mapping method
Affinity mapping groups observations by similarity. Write each observation on its own card or row, then read the cards together and move similar ones next to each other. The groups emerge from the notes, so you do not begin with categories.
Clustering observations bottom-up
Start with the observations, not the codes. Place observations that describe the same problem in one cluster. Use codes as a guide, not as the grouping rule. Leave single observations in a "miscellaneous" pile until you have reviewed the others.
Labeling clusters and splitting or merging them
Give each cluster a label that states what its observations share, such as "Setup takes more effort than expected." Split a cluster that contains two separate problems. Merge clusters that describe the same problem. Check each label against its notes before you keep it.
Exercise
Observation n5 says, "Had to ask support how to change the password." Which code should it receive, and why?
Show answer
navigation_confusion. The participant asks where a setting is, which matches the include rule in the codebook.