Foundations (Pt. 1)

Overview

This week we will be quickly covering the fundamentals of Python programming, while developing a critical appreciation of data science as an ongoing ‘process’ that calls for iterative improvement and deeper reflection. We will be contextualising computers within a wider landscape of geographical/spatial research. And we will be (briefly) reviewing the basics of Python with a focus on simple data structures. We’re focussing here on how computers ‘think’ and how that differs from what you might be expecting as an intelligen human being!

Learning Objectives
  1. A review of basic Python syntax and operators.
  2. An understanding of how none of this all that new.

So we will be contextualising all of this within the longer history of the study of geography (or planning!) through computation. I hope to convince you that many of the problems we face today are not new and why that should encourage you to continue to do the readings!

Preparatory Lectures

This week is very busy because we need to cover off the basics for those of you who were unable to engage with Code Camp, while recapping only the crucial bits for those of you who were able to do so.

Come to class prepared to present/discuss:

Session Video Presentation
Computers in Urban Studies In Class Slides
Principles of Programming In Class Slides
Python: the Basics (Part 1) Video Slides
Python: the Basics (Part 2) Video Slides
Lists Video Slides
Iteration Video Slides

Other Preparation

Reading List

Come to class having read:

Citation Article ChatGPT Summary
Burton (1963) URL Summary
Arribas-Bel and Reades (2018) URL Summary
Xie (2024) URL N/A
Mattern (2017) URL N/A

Study Guide

The following questions will help guide your reading and prepare you for class discussions:

  1. Evaluate the impact of the “quantitative revolution” on the field of Geography.
  • How do Burton’s (1963) views on the quantitative revolution differ from the perspectives presented in the more recent sources?
  • How has the relationship between geography and computing evolved over time?
  • Was the quantitative revolution a singular event or part of a more continuous process?
  1. Compare and contrast GIS, Geocomputation, and Geographical Data Science (GDS).
  • What are their core focuses and methodological approaches?
  • How do they differ in their relationship to technological change?
  • What are the unique contributions of GDS in the context of “big data” and the rise of data science?
  1. Consider the role of technological determinism in the evolution of geographical thought.
  • Do technological advancements determine the direction of geographical inquiry?
  • How do Arribas-Bel and Reades characterize the relationship between technological change and the development of geographical thought?
  • What evidence do they provide to support their view?
  1. Critically analyze the “city as computer” metaphor.
  • What are its strengths and weaknesses?
  • How does this metaphor shape our understanding of urban environments and the solutions we prioritize for urban challenges?
  • What aspects of cities does it overlook or oversimplify?
  • How does Shannon Mattern propose we move beyond this metaphor towards a richer understanding of urban intelligence?
  1. Discuss the benefits of a spatially grounded data science education.
  • What distinguishes GDS graduates from data scientists without specialized geographical training?
  • How does a GDS curriculum prepare students to address the growing demand for spatial awareness in various industries?
Connections

You should read Burton (1963) and Arribas-Bel and Reades (2018) with a view to seeing that ‘there is nothing new under the sun’: we tend to think that the challenges we face now in terms of data volumes and complexity are novel, but they are not. Indeed, here’s John Graham-Cumming keynoting a 2012 conference talking about the Lyons Tea Company and how its programmers invented Dykstra’s shortest path algorithm more than 20 years before Dykstra did!

Installing the Programming Environment

Warning

This week’s practical requires you to have completed installation of the programming environment. Make sure you have completed setup of the environment.

In principle, we fully support students who want to do things their own way; however, we are also not able to sit down with each person and develop a custom learning environment. With Docker, we can give you full access to the cutting-edge Python libraries and other tools needed to ‘do’ spatial data science, while only needing to install 1 application, download 1 (big) file, and run 1 command. When it works… There are alternatives, but there are more things that can go wrong and they can go wrong in more complex ways. Solving the Anaconda environment can take several hours before it even starts installing.

So here’s what we ask: if you already know what to do with an Anaconda YAML file, or can work out how to edit the Dockerfile and build a new image, then by all means knock yourself out! We are not going to tell you that cannot do something, and eventually you will need to learn to stand on your own two feet. But please do not expect us to support you individually if you’ve gone off and done your own thing and ‘it doesn’t work’. OK? We’ll offer advice (if we can) but only if no one else is waiting for help.

Practical

This week’s practical will take you through the fundamentals of Python, including the use of simple1 Boolean logic and lists. However, if you have not yet completed Code Camp (or were not aware of it!), then you will benefit enormously from tackling the following sessions:

  1. The Basics
  2. Boolean Logic
  3. Lists

To run the code for these sessions you can:

  1. Follow the instructions for running these in Google’s Collaboratory; or
  2. Create a new Notebook in Docker (File > New > Notebook) and copy+paste the code into new Code cells.
Connections

The practical focusses on:

  • Ensuring that you are set up with Git/GitHub
  • Reviewing Python basics
  • Reviewing Python lists and logic

To access the practical:

  1. Preview
  2. Download

References

Arribas-Bel, D., and J. Reades. 2018. “Geography and Computers: Past, Present, and Future.” Geography Compass 12 (e12403). https://doi.org/10.1111/gec3.12403.
Burton, I. 1963. “The Quantitative Revolution and Theoretical Geography.” The Canadian Geographer/Le Géographe Canadien 7 (4):151–62. https://doi.org/10.1111/j.1541-0064.1963.tb00796.x.
Mattern, Shannon. 2017. A City Is Not a Computer.” Places Journal. https://doi.org/10.22269/170207.
Xie, Tessa. 2024. “The Most Undervalued Skill for Data Scientists.” Towards Data Science. https://towardsdatascience.com/the-most-undervalued-skill-for-data-scientists-e0e0d7709321.

Footnotes

  1. Note: simple does not mean ‘easy’! Just because we say something is ‘basic’ or ‘simple’ does not mean that we think it is straightforward for someone learning to code for the first time!↩︎