Economics Department - Python

April 20, 2016
posts   python   Economics

Introduction

Python is popular general purpose language that is becoming very popular for doing data science. In this 3 session course we will focus on using python to work with data. You will learn how to store and work with data in addition to exploring data science tools to begin your own analysis. This course if intended for beginners. No programming experience is necessary.

We are using Software Carpentry Lessons for this workshop.

Topics

  1. Using libraries
  2. Working with arrays
  3. Reading and plotting data
  4. Creating and using functions
  5. Loops and conditionals
  6. Defensive programming
  7. Using Python from the command line
  8. Reference…
  9. Parallel computing
  10. Working with Data on the Web
  11. Python and databases

Table of Contents

Instructor

Tim Dennis, Data Librarian, UCSD (@jt14den)

Location

SSB 107

Date/Time

Schedule

Data

Other materials:

Setup

To participate in this workshop, you will need access to the software described below. In addition, you will need an up-to-date web browser.

We maintain a list of common issues that occur during installation as a reference for instructors that may be useful on the Configuration Problems and Solutions wiki page.

Python

Python is a popular language for scientific computing, and great for general-purpose programming as well. Installing all of its scientific packages individually can be a bit difficult, so we recommend Anaconda, an all-in-one installer.

Regardless of how you choose to install it, please make sure you install Python version 3.x (e.g., 3.5 is fine).

We will teach Python using the IPython notebook, a programming environment that runs in a web browser. For this to work you will need a reasonably up-to-date browser. The current versions of the Chrome, Safari and Firefox browsers are all supported (some older browsers, including Internet Explorer version 9 and below, are not).

Windows

  1. Open http://continuum.io/downloads with your web browser.
  2. Download the Python 3 installer for Windows.
  3. Install Python 3 using all of the defaults for installation except make sure to check Make Anaconda the default Python.

Mac OS X

  1. Open http://continuum.io/downloads with your web browser.
  2. Download the Python 3 installer for OS X.
  3. Install Python 3 using all of the defaults for installation.

Linux

  1. Open http://continuum.io/downloads with your web browser.
  2. Download the Python 3 installer for Linux.
  3. Install Python 3 using all of the defaults for installation. (Installation requires using the shell. If you aren’t comfortable doing the installation yourself stop here and request help at the workshop.)
  4. Open a terminal window.
  5. Type bash Anaconda- and then press tab. The name of the file you just downloaded should appear.
  6. Press enter. You will follow the text-only prompts. When there is a colon at the bottom of the screen press the down arrow to move down through the text. Type yes and press enter to approve the license. Press enter to approve the default location for the files. Type yes and press enter to prepend Anaconda to your PATH (this makes the Anaconda distribution the default Python).

Your Librarian