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.

Schedule updates

  • Thanksgiving

  • Guest speaker

In-class exercise part two

Plot Access to Electricity against the World Happiness Report scores for a specific country over time. Relevant things:

Reading an Excel file

Worst case, you can convert the data to CSV and read that.

Pivoting

Pandas supports reshaping DataFrames through pivoting, like spreadsheets do.

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.