Lecture 21: Visualization exercise, continued#

Schedule updates#

  • Project 1

  • Lecture topics

  • Thanksgiving

  • Guest speaker

In-class exercise from last time#

Show the change in Access to Electricity by country over time, using World Development Indicators data.

Pivoting#

Pandas supports reshaping DataFrames through pivoting, like spreadsheets do.

In-class exercise part two#

Plot against World Happiness Report data for a specific country.

Two Y axes#

The plotly.graph_objects syntax is a bit different than the plotly.express syntax we’ve been using. With go.Scatter(), you don’t provide the DataFrame and the names of the columns; you pass x and y as lists/Series of the values themselves.