Cleaning the World Cup Matches dataset

data-cleaning
Author

Rene Valenzuela

Published

August 14, 2026

Modified

August 19, 2026

Introduction

This post documents, end to end, how the raw World Cup Matches dataset is cleaned before it’s used in the World Cup hosting premium analysis. Keeping the cleaning steps in their own post makes them traceable and reproducible independent of any downstream analysis, and the resulting cleaned dataset is what gets published to Kaggle.

Data sources

World cup hosts

The host nations for each of the World cups is extracted from Wikipedia

year host_nation confederation
1930 Uruguay CONMEBOL
1934 Italy UEFA
1938 France UEFA
1950 Brazil CONMEBOL
1954 Switzerland UEFA
1958 Sweden UEFA
1962 Chile CONMEBOL
1966 England UEFA
1970 Mexico CONCACAF
1974 Germany FR UEFA
1978 Argentina CONMEBOL
1982 Spain UEFA
1986 Mexico CONCACAF
1990 Italy UEFA
1994 United States of America CONCACAF
1998 France UEFA
2002 Republic of Korea AFC
2002 Japan AFC
2006 Germany UEFA
2010 South Africa CAF
2014 Brazil CONMEBOL
2018 Russia UEFA
2022 Qatar AFC
2026 Canada CONCACAF
2026 United States of America CONCACAF
2026 Mexico CONCACAF

World cup games

The raw data comes from the FIFA World Cup dataset on Kaggle. Specifically the WorldCupMatches.csv dataset.

Cleaning steps

Manual edits

  • Some records had the dates recorded as June/July instead of Jun/Jul. These records were manually modified in the .csv file to ease further processing.
  • In the 1982 World Cup the second group stage games were manually changed from 14 to AD, so the stage labels are consistent across tournament years and need to be normalized before they can be used.
  • Manuall deleted extra string in 3 countries Bosnia and Herzegovina

Deduplication

Column names normalization

The raw column names are verbose and inconsistently cased, so they’re mapped to short, snake_case names:

Original name Normalized name
Year year
Datetime match_start
Stage stage
Stadium venue
City city
Home Team Name home_team
Away Team Name away_team
Home Team Goals home_ft_goals
Away Team Goals away_ft_goals
Win conditions resolution_type
Attendance attendance
Half-time Home Goals home_ht_goals
Half-time Away Goals away_ht_goals
Referee referee
Assistant 1 assistant_1
Assistant 2 assistant_2
RoundID round_id
MatchID match_id
Home Team Initials home_initials
Away Team Initials away_initials

Type normalization

Integers
Datetime
Categorical
Stage
Resolution type
Home team and Away team

Output

The cleaned dataset is written out for downstream use (and eventual publication to Kaggle):