Activity 5: Exporting Data for Visualization
Due: On git by Tuesday, Feb. 7, 2017 at 9:30am
Team: This is a solo assignment.
Grading: This assignment is worth 20 points.

Overview

In lecture, we have started to look at turning data into visual encodings using JavaScript code to create visualizations. In this activity, you will develop a complete Python program that exports that data you will be using for your visualization.


Initial Files

A new directory has been created on the release git repository, which you should complete this assignment in. To merge this into your repository, navigate to your workbook directory using a command line and run the following commands:

git fetch release
git merge release/activity5 master -m "merge"


Assignment

You will complete this assignment in a jupyter notebook inside of the activity5 directory. To open up the jupyter notebook, run the following command:

jupyter notebook

Our visualization needs five pieces of information about each major:

  • Name of the major
  • Total majors in 2005
  • Total majors in 2015
  • %female in 2005
  • %female in 2015

Using pandas, create a jupyter notebook that reads in uiuc_demographics_2005_15.csv, and processes the data to create rows containing only the five fields described above.

Doing so will require all of the commands you have already learned, plus you will need to explore how to merge data from two rows into one row. This can be done several ways, including using .pivot or .merge. Using the pandas cheet sheet and Google search are great ways to get started!

Once you have a DataFrame in good shape, save it to a CSV file with the following command:

df.to_csv("visualizationData.csv")

After running the .to_csv command, you will find the file visualizationData.csv in your activity5 directory. Open it up in Excel to make sure it has all the data you expect.

Make sure to save your notebook before closing your browser or command line!


Submission

This activity is submitted digitally via git. View detailed submission instructions here.