Find us on GitHub

Virtual Python Programming- School of Global Policy and Strategy

Jan 25-Feb 11, 2021

12:30pm-1:50pm

Instructors: Kimberly Thomas (Research ITS), Harry Zhao (Research ITS)

Helpers: Reid Otsuji, Rick Mccosh, Stephanie Labou, TA: Chi Gao

General Information

This is the website for the School of Global Policy and Strategy short introductory course in Python programming based on the Software Carpentry Python lesson. This course will introduce you to the Python programming language and how to use Python and the Jupyter Notebook to work with data. In order to earn a certificate of proficiency, you must attend all of the class meetings for the course, do the short coding assignments, and pass the short, in-class quiz at the end of the course.

Who: The course is aimed at GPS graduate students. You don't need to have any previous knowledge of the tools that will be presented in the class.

Where: Zoom Meeting, 9500 Gilman Drive, #0519, La Jolla, CA. Zoom - link and access information in Canvas

Requirements: Participants must bring a laptop with a few specific software packages installed (listed below).

Contact: Please mail rotsuji@ucsd.edu for more information.

Assessment: A certificate of proficiency will be given to students who:

  • Attends all classes
  • Passes all in-course quizzes
  • Satisfactorily completes the weekly assignments

Need help? Post in Canvas discussion, Visit TA office hours or Email: rotsuji@ucsd.edu


Schedule

schedule
Date Class Topics
Jan. 26 Lecture Class Intro/Setup/Python Intro, Jupyter Notebook Overview, Running and Quitting, Variables and Assignment(basic math examples)
Jan. 28 Lecture Data Types and Type Conversions, Built-in Functions and Help
Quiz & Assignment No quiz or assignment
Feb. 2 Lecture Libraries, Errors and Exceptions
Feb. 4 Lecture Reading Tabular Data into Dataframes, Pandas DataFrames
Quiz & Assignment 1 Quiz 1 -- Assignment 1 - posted in Canvas
Feb. 9 Lecture Plotting, Lists, For Loops
Feb. 11 Lecture Looping Over Data Sets, Conditionals
Quiz & Assignment 2 Quiz 2 -- Assignment 2 - posted in Canvas

HackMD Collaborative Notes: https://hackmd.io/avGpM3iiTZ6cdO5p2RXsow.
We will use this HackMD for taking notes, and sharing URLs and bits of code.


Syllabus

Programming in Python

  • Using libraries
  • Working with arrays
  • Reading and plotting data
  • Creating and using functions
  • Loops and conditionals
  • Defensive programming
  • Using Python from the command line
  • Reference...


Setup

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

Text Editor

When you're writing code, it's nice to have a text editor that is optimized for writing code, with features like automatic color-coding of key words. The default text editor on Mac OS X and Linux is usually set to Vim, which is not famous for being intuitive. if you accidentally find yourself stuck in it, try typing the escape key, followed by :q! (colon, lower-case 'q', exclamation mark), then hitting Return to return to the shell.

Windows

nano is a basic editor and the default that instructors use in the workshop. To install it, download the Software Carpentry Windows installer and double click on the file to run it. This installer requires an active internet connection.

Others editors that you can use are Notepad++ or Sublime Text. Be aware that you must add its installation directory to your system path. Please ask your instructor to help you do this.

Mac OS X

nano is a basic editor and the default that instructors use in the workshop. It should be pre-installed.

Others editors that you can use are Text Wrangler or Sublime Text.

Linux

nano is a basic editor and the default that instructors use in the workshop. It should be pre-installed.

Others editors that you can use are Gedit, Kate or Sublime Text.

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.4 is fine).

We will teach Python using the Jupyter 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 Anaconda downloads with your web browser.
  2. Download the Anaconda installer for Windows.
  3. Install Anaconda using all of the defaults for installation.

Mac OS X

  1. Open Anaconda downloads with your web browser.
  2. Download the Anaconda installer for OS X.
  3. Install Anaconda using all of the defaults for installation.

Linux

  1. Open Anaconda downloads with your web browser.
  2. Download the Anaconda installer for Linux.
  3. Install Anaconda 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.)

Once you are done installing the software listed above, please go to this page, which has instructions on how to test that everything was installed correctly.