The World in Muslim Populations

Post date: Oct 09, 2009 8:8:3 AM

After reading the Guardians datablog, specifically this post, where they frequently publish datasets, I grabbed their dataset on the muslim populations in the world. I thought I should take them up on their request on what we, the readers, could do with the dataset. The first thing I thought about was of course, since this was a google spreadsheet, to use the google heatmap gadget. This proved to be not without its issues.

First, the google heatmap gadget requires two or more columns, the first column consisting of ISO Country codes, e.g., United Kingdom=GB and Norway=NO, and the second and more columns requires numbers, or an empty cell.

The ISO Code is actually easy to introduce(albeit not without flaws), using Google's Lookup.

First create a new column next to the countries (on the right actually):

Then write in =GoogleLookup(A2,"ISO Code") in the cell where you would like the first ISO code (where A2 should match the country name next to it).

E.g. =GoogleLookup("Afghanistan","ISO Code") will result in AF

After the first cell with an iso value is created, you can drag the tiny square in the bottom right corner of that cell down to the bottom of that column. This will repeat this formula, in a smart manner, for every cell.

First problem, some of the ISO values are listed as N/A, i.e. google did not get a good guess. I just removed a whitespace behind the name, and then it found it.

Second problem, Kosovo. Actually it does not have an iso code yet. It has one reserved, but google heatmap does not recognize it.

Third problem, several countries has a three letter ISO code that does not correspond to the ISO list. Ok, google lookup is not perfect, but I had those corrected manually. It was about four or so, e.g. Somalia to SOM instead of SO which is its correct ISO.

Next issue, columns only containing numbers. This is easy to fix, by a) replacing all the "--" with empty cells, and removing all the "<" signs (this is of course not too god, but we need a number).

And here is the result, grey countries indicating a missing value. I must admit the lack of interaction with this "image" is somewhat frustrating, and that the large gap in colors makes this map very un quantitative.

(Image removed due to errors)