Contents:


  1. Using libraries in Python

    Programming would be incredibly time consuming if you couldn't reuse code. You've seen the basic form of code reuse already---the function, which allows you to lock up a transformation from some data to some other data, give it a name, and then apply it repeatedly, and to arbitrary data.

    Well …

    read more
  2. Files and How Computers Represent Data

    In this lesson, we're going to learn how to open files and work with data from the disk. We'll start with the mechanical process of opening text files, and then move on to learn a little bit more about different kinds of data you'll see.

    Here's the basic method of opening and reading text files. Suppose I have a file called hello.txt in my working directory. (Your working directory is the directory you run Python from on your hard drive. For those of you using Azure Notebooks, this should be your library, but talk to me if you see a file there and can't read it from Python.)

    read more
  3. In-class example: talking to an API

    This is a lightly edited version of the notebook that we worked through in class on 1/22/19.

    In class, we went through how to make an API call end-to-end, to get a look at common tasks like figuring out documentation, using libraries, making HTTP requests, etc. Over the weekend, practice with this API and others (you might also try the one at opensecrets.org read more

links