joining-data
Our World in Data supplies a lot of important data at a national level for multiple years.
Joining data
When joining data from Our World In Data with that of other sources, the following should be taken into account:
- OWID data usually comes as a dataframe with two dimensions: time (almost always the year) and entity (almost always the country and/or geographic region like continents or World)
- OWID data uses harmonized country names and region codes (ISO alpha-3 for standard countries, custom codes for unusual regions like OWID_WRL for World)
- If external data has ISO alpha-3 codes, use those for joining
- If external data uses other identifiers (e.g. ISO alpha-2), map them to ISO alpha-3 first
- OWID uses modern country borders for historical data (e.g. Italy population in 1 CE uses modern Italian borders)
- Regional aggregates like "Europe" or "Sub-saharan Africa" usually differ between sources - do not join these by name
- When external data lacks a year column, determine the correct year from documentation or ask the user, then join on that year
OWID data that is commonly used for joins
Some data that OWID provides, like population, is especially useful, for example to convert metrics into per-capita data. Recommendations for these are given below. To understand how to download data given a chart url, consult the fetch-chart-data skill.
For population there are two relevant time series.
- the long-run population numbers, used in the chart https://ourworldindata.org/grapher/population that merges several data sources to provide data from 10.000 BCE to the present (up to one to three years ago). The precise temporal extent can be quickly queried by fetching the metadata for this chart, and reading
$.columns.[0].timespan - the UN population data from 1950 with projections up to 2100 (medium scenario) used in the chart https://ourworldindata.org/grapher/population-with-un-projections . Use this if you need years more recent than what is available in the long-run population dataset or for the current or future years.
More from owid/owid-claude-plugins
uv
We always use `uv` for running python scripts (both standalone and complex python projects) and managing python dependencies. Always use this instead of running system `python`, `python3`, `pip` or `pip3`
1fetch-chart-data
This skill describes how to fetch data for an Our World In Data chart, once the relevant chart URL has been identified. Consult this skill to understand the possible query params to get the best results and to understand the response. Use it you need to fetch data and have already identified the relevant chart URL.
1search-charts
Our World In Data offers thousands of charts and related data on many important topics - from global population data, energy and electricity, economic data like GDP or poverty, health data like causes of death or prevalence of diseases, to data on democracy, violence and war. This skill describes how to effectively search for charts to either show visually or download the data for.
1owid-catalog
Access Our World In Data's published datasets using the owid-catalog Python library. Provides a unified Python API for searching and fetching chart data, catalog tables, and indicators — returning enhanced pandas DataFrames with metadata. Use this as a Python-native alternative to the HTTP-based search-charts and fetch-chart-data skills.
1