Data

Week 2 lecture

Open full screen ↗ Week 2 workshop → F full screen · S speaker notes · ? shortcuts

Explore it: one row per observation

These are the lecture's World Bank GDP figures for three countries and three years. The numbers never change; only the layout does. Switch layout, add a second variable, then try to draw a chart by assigning columns to x, y and colour. A chart (or a groupby, or a regression) can only use a variable if it has a column of its own.

Layout

The table

    Map columns to a chart

    Try

    Tap or hover a number (in the table or the chart) to see where each of its facts is stored. * marks a column header that is really a value. GDP in current US$ billions, as shown in the lecture (World Bank; later revisions have changed some figures, notably Angola). Unemployment: % of labour force, modelled ILO estimate, World Bank SL.UEM.TOTL.ZS. The chart builder works like seaborn or plotly express, which expect long data; pandas' own .plot() wants one column per line, which is why the workshop pivots back to wide just before plotting.