Timestamp
1990-2022
Data source
Dataset
modified_flourish_wide_format_countries_with_flags.csv
Protocol
Flourish + Python
Preprocessing steps:
- Load the dataset: Read the CSV file (
modified_tableau_wide_format_countries_with_flags.csv
) into a Pandas DataFrame. - Map countries to continents: Create a new
Continent
column by mapping country names in theArea
column to their corresponding continent using thecountry_to_continent
dictionary. - Drop missing mappings: Remove rows where the
Continent
mapping is missing (i.e.,NaN
in theContinent
column). - Aggregate data by continent: Group the dataset by the
Continent
column and sum all numeric columns. - Save the transformed dataset: Write the aggregated dataset to a new CSV file at the specified output path.