Before we can focus on mapping, we need to address one last aspect of the data. The mapping tool in Pygal expects data in a particular format: countries need to be provided as country codes and populations as values. Several standardized sets of country codes are frequently used when working with geopolitical data; the codes included in population_data.json are three-letter codes, but Pygal uses two-letter codes. We need a way to find the two-digit code from the country name.

