Welcome

Well hi there! Are you a Computer Scientist? If so, this site probably isn’t for you.

This site is for everyone else—especially our future MSc Urban Spatial Science students—looking to learn some basic Python, together with a bit about the other tools that we think people should know, before the start of term.

What will you learn?

So what can you expect to learn? By the end of the course, we hope that you will have a basic understanding of:

  1. The range of tools that we use to do urban spatial science, a sense of why we use them, and how they connect with tools used by practicing researchers and programmers.
  2. The fundamental concepts of programming used in Python so that you can ‘read’ Python code and begin to recognise how to do things using Python.
  3. How programs and libraries are structured so that your code remains manageable and, above all, legible.
  4. How your newly-acquired coding skills can help you be usefully lazy because that, ultimately, is what computers do: they make tedious, repetitive problems ‘go away’, though they often create or reveal much more complex, novel problems in turn.

Code Camp is all about building blocks: helping you to learn the fundamentals so that when classes start you (hopefully) feel like you already have the lay of the land. We can’t make learning to code easy any more than we can make learning to speak French or Chinese (or English!) easy, but if you work your way through these lessons it will be easier to hit the ground running in Week 1.

How will you learn?

We’ve tried to break everything down into manageable ‘units’ of learning that you can follow at your own speed in the run-up to the start of term. We’d strongly recommend that you don’t try to cram Code Camp into the last week before classes start; instead, you should aim to complete two or three lessons a week (and allow time to go back and test yourself!) so that you complete it over the course of four to eight weeks (1-2 months).

Each lesson will contain a mix of explanation and code that can be run interactively in a variety of ways (see Setting Up). Some code will run first-time (you just copy+paste), some code will require you to ‘fill in the blanks’ (though the blanks, in this case, are marked by ??), and some code will be deliberately broken so that you have to debug it and work out what’s wrong1.

So rather than throw you in at the deep end with examples taken from computer science classes (e.g. ‘This is just like the C construct…’), we’ve tried to give you real world examples whenever possible in the hopes that it will seem a little less abstract and a little more relevant to your needs. Of course, the early examples are also very basic so the payoff might not be obvious right away, but trust us: if you stick with it you will learn how to speak a new language that gives you superpowers for dealing with data!2

Lessons

The lessons are organised to build from the general and basic, to the specific and advanced. You need to learn about variables and operators before you can learn about functions and classes. But along the way we also try to introduce other ideas and tools (such as working with the Terminal and how to write Markdown) that will support your coding skills. While there are some important differences, a lot of what makes a good programmer is the same as what makes a good anything: persistence, attention to detail, and communicating clearly and succinctly.

Lesson Plan {#cell-lesson-plan}
Lesson Time Needed Title & topic Link
0 00:10:00 Introduction: Doing Urban Spatial Science Lesson
1 00:25:00 Background: Why We Do What We Do Lesson
2 00:45:00 The Basics: Variables, Operators & Precedence Lesson
3 00:40:00 Exceptions: What to Do When Things Go Wrong Lesson
4 00:20:00 Writing Code: A Matter of Style Lesson
5 01:15:00 Boolean Logic: Comparisons, Conditions & George Boole Lesson
6 01:35:00 Recap 1 Lesson
7 01:00:00 Lists: Making a List (and Checking it Twice) Lesson
8 00:40:00 Dicts: Look it up in the Dictionary Lesson
9 00:50:00 Loops: Let’s Iterate This Lesson
10 00:50:00 Recap 2 Lesson
11 01:25:00 Functions: Automate All the Things Lesson
12 00:40:00 Packages: Giving Yourself a Present Lesson
13 00:55:00 Classes: How to Objectify Things in Python Lesson
14 00:35:00 The Terminal: No More Buttons to Press Lesson

More Help

It’s entirely possible that Code Camp doesn’t suit you: you want assessments, you want a more general introduction to Python, etc. Whatever, Code Camp is there to help you, and if it’s not helping then don’t worry about completing it.

Instead, what we’d suggest is that you look for alternatives that do suit! There are lots of ‘introduction to Python’ online classes out there: Kaggle, Codcademy, Codefinity, Learn Python, Coursera, Microsoft, DataCamp, Udacity, Software Carpentry… and lots more! We’re not going to recommend a specific online module – you’ll have to see for yourself which style suits you best – but this hopefully makes the point that there’s no excuse for not learning some basic Python before the start of your class.

And the real takeaway here should be this: the more you do now, the easier it’ll be later. Just like learning a new language. Good luck!

Footnotes

  1. Fun fact: the term ‘debugging’ was coined by the rather impressive Grace Hopper, who found an actual bug in the computer she was working with that was causing programs to fail.↩︎

  2. Unfortunately, no other superpowers are likely to be uncovered.↩︎