Are You Just
‘Organising It’?

Part 2

Jon Reades - j.reades@ucl.ac.uk

22nd October 2026

What’s the Key (Idea)?

Reports or Events?

stories = [('BBC','Chibok'), ('CNN','Chibok'),
           ('Japan Times','Chibok'), ('SaharaReporters','Chibok')]

counts = {}
for outlet, event in stories:
  counts[event] = counts.get(event, 0) + 1

print(len(stories))
print(counts)
4
{'Chibok': 4}

Four kidnappings, or one kidnapping reported four times?

What is GDELT Measuring?

So what is it really that GDELT is measuring? What events are happening in the world, or what the major international news organizations are focusing their attention on? ~ D’Ignazio and Klein (2020, 16)

Spot the Problem

From LOLs (“Making This Useful”):

my_cities = [
  ['London', 51.5072, 0.1275, +0],
  ['New York', 40.7127, 74.0059, -5],
  ['Tokyo', 35.6833, 139.6833, +8]
]

What’s wrong with this data?

The Numbers Don’t Speak for Themselves

On my slide Actually
London longitude 0.1275 -0.1275
New York longitude 74.0059 -74.0059
Tokyo time zone1 +8 +9 (winter), +8 (summer)
New York time zone -5 -5 (winter), -4 (briefly in spring)

Actually, it depends on where you’re measuring from: London or UTC!

“‘Raw data’ is an oxymoron” ~ Gitelman and Jackson, quoted in D’Ignazio and Klein (2020, 13)

What Can’t Be a Column?

What place-based “information” doesn’t fit on a shelf or in a database? What are the non-textual, un-recordable forms of cultural memory? ~ Mattern (2017)

Break It, Then Fix It

Why the Command Line?

The last 100,000 crimes reported to Chicago police in 2025 (28MB)1:

wc -l data/crimes2025.csv                 # how many rows?
head -2 data/crimes2025.csv               # what are the columns?
cut -d, -f6 data/crimes2025.csv | sort | uniq -c | sort -rn | head

About two seconds for 100,000 rows, and no Python.

Is That Right?

grep -c '"HOMICIDE"' data/crimes2025.csv                    # 194
grep '"HOMICIDE"' data/crimes2025.csv | grep -c '"true"'    # arrests?

That’s not the number of homicides with an arrest: it’s 3 too many. Why?

awk -F, '{print NF}' data/crimes2025.csv | sort | uniq -c   # 22 columns?

From CSV to a Dict of Lists

import csv
import urllib.request

url = 'https://data.cityofchicago.org/resource/t7ek-mgzi.csv?$limit=20'

with urllib.request.urlopen(url) as f:
    rows = list(csv.reader(f.read().decode('utf-8').splitlines()))

header = rows[0]   # the column names
data   = rows[1:]  # a list of lists: one list per crime

crimes = {}        # a dict of lists: one list per column
for col in ['date', 'primary_type', 'block', 'arrest', 'latitude']:
    i = header.index(col)
    crimes[col] = []
    for row in data:
        crimes[col].append(row[i])

Ask the Data

In pairs, write down the code before I run it:

  1. How many of the 20 led to an arrest?
  2. What is the average latitude?
  3. Look at rows 2 and 4. One crime or two?

Gitting More
Out of Life

Break It

A reproducible sequence of interactions:

mkdir tmp
cd tmp
git init
echo "Test" > fileA.md
git add fileA.md
git commit -m "Added."
git rm fileA.md
git commit -m "Removed file."
ls                       # fileA.md has gone
git log --oneline        # find the hash before the removal
git checkout <hash>
ls                       # fileA.md is back

Detached HEAD

git status               # HEAD detached at <hash>
git switch -             # back to the branch you were on

To bring one file back into the present:

git restore --source=<hash> fileA.md
git add fileA.md
git commit -m "Restored fileA.md"

Commits on a Plane

CVS (1990), Subversion (2000) Git (2005)
Where is the history? On one central server In every copy
Commit offline? No Yes
GitHub is… (n/a) just another copy

So commit and push are different things.

Pull, Then Push

git pull                 # get any changes from GitHub first
git add <notebook.ipynb>
git commit -m "What I did, and why"
git push                 # only now are you backed up

When asked for a password, GitHub wants a personal access token (or an SSH key), not your account password.

A Commit Message Is Context

The way through this predicament is by considering context, a process that includes understanding the provenance and environment from which the data was collected […] ~ D’Ignazio and Klein (2020, 27)

git log is the provenance of your work. Write the message for the person who will read it in six months.

Intro to the practical

Here’s what we’re covering:

  • Bedding in your Git/GitHub workflow. We’re trying to help you remember via repetition here and get good habits started early.
  • Lists and dictionaries are the ‘workhorse’ data structures of Python: you’ll use them all the time even once you know of other, more powerful ways to organise and manage data. You might, for instance, have a list of advanced data structures that you want to iterate over. Or a dictionary of parameters that you want to test in a model.
  • We’re also going to stretch your understanding of how these two data structures interrelate and, crucially, look at the DOL, which is analogous to how pandas — probably the single biggest reason Python dominates data science — manages and represents data to you.

Before You Go…

Complete the sentence:

 

How I store data is / isn’t a neutral choice, because…

 

A selection will open next week’s session.

Input

Provide your input here: form.menti.com/s/albxtzgfabbm

Mentimeter QR Code

Mentimeter QR Code

Thank You

References

D’Ignazio, Catherine, and Lauren F. Klein. 2020. “Data Feminism.” In. MIT Press. https://data-feminism.mitpress.mit.edu/.
Mattern, Shannon. 2017. “A City Is Not a Computer.” Places Journal. https://doi.org/10.22269/170207.