Plotting and Programming in Python - Part 1

This lesson is an introduction to programming in Python for people with little or no previous programming experience. It uses plotting as its motivating example, and is designed to be used in both Data Carpentry and Software Carpentry workshops. This lesson references the Jupyter Notebook, but can be taught using a regular Python interpreter as well. Please note that this lesson uses Python 3 rather than Python 2.

Prerequisites

  1. Learners need to understand what files and directories are, what a working directory is, and how to start a Python interpreter.

  2. Learners must install Python before the class starts.

  3. Learners must get the gapminder data before class starts: please download and unzip the file python-novice-gapminder-data.zip.

    Please see the setup instructions for details.

Schedule

Setup Download files required for the lesson
09:30 1. Running and Quitting How can I run Python programs?
09:45 2. Variables and Assignment How can I store data in programs?
10:15 3. Data Types and Type Conversion What kinds of data do programs store?
How can I convert one type to another?
10:45 4. Morning Break Break
11:00 5. Built-in Functions and Help How can I use built-in functions?
How can I find out what they do?
What kind of errors can occur in programs?
11:35 6. Libraries How can I use software that other people have written?
How can I find out what that software does?
12:00 7. Lunch Break
13:00 8. Reading Tabular Data into DataFrames How can I read tabular data?
13:25 9. Pandas DataFrames How can I do statistical analysis of tabular data?
14:00 10. Afternoon Break Break
14:10 11. Plotting How can I plot my data?
How can I save my plot for publishing?
14:45 Finish/Survey

The actual schedule may vary slightly depending on our group's interests and expertise.