Have students develop a geographic visualization of Twitter data across America in Python to give them experience using dictionaries, lists, and data abstraction techniques.

  • The process for developing this geographic visualization is as follows:
    1. Collect public Twitter posts (tweets) that have been tagged with geographic locations and filter for those that contain a certain query term,
    2. Assign a sentiment (positive or negative) to each tweet, based on all of the words it contains,
    3. Aggregate tweets by the state, and finally
    4. Color each state according to the aggregate sentiment of its tweets. Red means positive sentiment; blue means negative.
  • For the full assignment, visit Stanford’s nifty assignment page.