Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Assignment 2

CSci 39579: Introduction to Data Visualization

Department of Computer Science, Hunter College, City University of New York
Spring 2026


All students must join the course’s gradescope using the provided access code: WN433V. Students must verify that their Gradescope account has their full name and CUNY email address in the account settings (Account > Edit Account).

Unless otherwise noted, programming assignments are submitted on the course’s Gradescope site and are written in Python. Code must be submitted in the form of a .ipynb with all cells containing output. Also, to receive full credit, the code should be compatible with Python 3.6 and written in good style.

To get full credit for a program, the file must include in the opening comment:

  • Your name, as it appears in your Gradescope registration.

  • The email you are using for Gradescope.

  • A list of any resources you used for the program. Include classmates and tutors that you worked with, along with any websites or tutorials that you used. If you used no resources (other than the class notes and textbooks), then you should include the line: “No resources used.”

For example, for the student, Thomas Hunter, the opening comment of his first program might be:

"""
Name:  Thomas Hunter
Email: thomas.hunter1870@hunter.cuny.edu
Resources:  Used python.org as a reminder of Python 3 print statements.
"""

and then followed by his Python program.

Program 2: Worldwide Mapper

Due date: 17/03/2026

Learning Objective: Altair is a declarative statistical visualization library for Python, based on Vega and Vega-Lite. In this assignment, you are going to create basic geographic visualizations using Altair.

Available Libraries: Core Python 3.6+, Altair, Kaggle, Matplotlib, Plotly, and Pandas.

Part 1

For the first part of this assignment, your goal will be to recreate the following visualization.

For this code, check out the available link for the vega-lite specification, and use it as a baseline for implementing the altair code to recreate the output.

For each line of code, you are required to comment the line number that you drew reference from, and the explaination for the line.

Minimal points will be provided for a recreation that lacks sufficient justification/explaination.

import altair as alt
from vega_datasets import data

df = data.windvectors()

wind_chart = # Your code goes here
df.head()
Loading...

Part 2

Using the following data source:

Construct a map of all the NYC MTA transit stops.

You must:

  • Use an appropiate projection

  • Transform the map to project the correct area

  • Make each node have relevant information (Trains that stop there, Borough, etc)

  • Explain your code via comments

import pandas as pd

url = "https://raw.githubusercontent.com/slimsaelim/nyc-subway-tracker/master/mta_stations.csv"
stations = pd.read_csv(url)

# Your code goes here
stations.head()
Loading...

Consider how you would construct a map similar to that of the transit map.

  • How would you do it? (You do not need to implement it)

  • How do you account for lines that overlap?

  • What are some of the advantages to losing geographic accuracy?

Submission instructions

Ensure that your notebook contains:

  • all necessary code,

  • the visualizations,

  • relevant explainations

We will grade based on what is available in that repository.

Submit the file to gradescope and make sure the preview shows your notebook

If you’d like a early review of your submission, email me at rv846@hunter.cuny.edu.

Recommendations

  • Before trying to make a visualization, ask yourself a key question about the dataset that you’d need a visualization to show.

  • Think about your prior knowledge of the data, and apply it to justify(or disprove) your own beliefs.

  • For the personal dataset, choose something that intrests you, it does not necessarily have to be a concrete finding.

  • Focus on making visualizations that efficiently communicate the idea you want to send

    • This means that your explaination will sound incredibly repetitive to the image

  • Use the code from Lectures 6 and 7 for reference