Last active
August 29, 2015 14:08
-
-
Save sir-deenicus/dc2336d2f55b4e855fba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Algeria | 5.86 | 0.93 | |
---|---|---|---|
Angola | 5.09 | 0.88 | |
Argentina | 6.39 | 0.66 | |
Australia | 8.67 | 0.32 | |
Austria | 7.73 | 0.55 | |
Azerbaijan | 5.6 | 0.495 | |
Bangladesh | 5.07 | 1.0 | |
Belgium | 7.51 | 0.33 | |
Brazil | 6.52 | 0.865 | |
Bulgaria | 5.73 | 0.335 | |
Canada | 7.74 | 0.42 | |
Chile | 7.1 | 0.695 | |
Colombia | 6.27 | 0.825 | |
Costa Rica | 6.92 | 0.79 | |
Croatia | 6.06 | 0.665 | |
Cuba | 6.39 | 0.335 | |
Cyprus | 7.1 | 0.75 | |
Czech Republic | 6.96 | 0.205 | |
Denmark | 8.01 | 0.18 | |
Dominican Republic | 5.93 | 0.86 | |
Ecuador | 5.7 | 0.82 | |
Egypt | 5.76 | 0.98 | |
El Salvador | 5.72 | 0.83 | |
Estonia | 6.07 | 0.16 | |
Finland | 7.76 | 0.28 | |
France | 7.04 | 0.295 | |
Germany | 7.38 | 0.405 | |
Greece | 6.65 | 0.715 | |
Hong Kong | 7.8 | 0.23 | |
Hungary | 6.06 | 0.39 | |
India | 5.67 | 0.79 | |
Indonesia | 5.54 | 0.99 | |
Iran | 5.78 | 0.825 | |
Ireland | 7.75 | 0.535 | |
Israel | 7.23 | 0.495 | |
Italy | 7.21 | 0.715 | |
Japan | 7.08 | 0.235 | |
Jordan | 5.63 | 0.965 | |
Kazakhstan | 5.2 | 0.43 | |
Kenya | 5.17 | 0.94 | |
Kuwait | 7.18 | 0.925 | |
Latvia | 6.01 | 0.39 | |
Lithuania | 5.82 | 0.415 | |
Malaysia | 6.62 | 0.955 | |
Mexico | 6.41 | 0.72 | |
Morocco | 5.67 | 0.985 | |
Netherlands | 7.94 | 0.245 | |
New Zealand | 7.95 | 0.33 | |
Nigeria | 4.75 | 0.955 | |
Norway | 8.09 | 0.205 | |
Pakistan | 4.91 | 0.965 | |
Peru | 6.24 | 0.835 | |
Philippines | 5.71 | 0.955 | |
Poland | 6.66 | 0.745 | |
Portugal | 6.92 | 0.715 | |
Russia | 5.31 | 0.33 | |
Saudi Arabia | 6.49 | 0.945 | |
Serbia | 5.86 | 0.505 | |
Singapore | 8.0 | 0.7 | |
Slovakia | 6.64 | 0.465 | |
Slovenia | 6.77 | 0.47 | |
South Africa | 5.89 | 0.845 | |
South Korea | 7.25 | 0.325 | |
Spain | 6.96 | 0.495 | |
Sri Lanka | 5.71 | 0.99 | |
Sweden | 8.02 | 0.165 | |
Switzerland | 7.88 | 0.415 | |
Taiwan | 7.67 | 0.45 | |
Thailand | 5.96 | 0.94 | |
Tunisia | 5.77 | 0.93 | |
Turkey | 5.95 | 0.895 | |
Ukraine | 4.98 | 0.455 | |
United Arab Emirates | 7.33 | 0.91 | |
United States | 7.38 | 0.65 | |
Venezuela | 6.07 | 0.79 | |
Vietnam | 5.64 | 0.295 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bornIndex = new HtmlProvider<"http://en.wikipedia.org/wiki/Where-to-be-born_Index">() | |
let religiousity = new HtmlProvider<"http://en.wikipedia.org/wiki/Importance_of_religion_by_country">() | |
let bindex = bornIndex.Tables.``2013 rankings``.Rows | |
let rindex = religiousity.Tables.Countries.Rows | |
let cname0 = bindex |> Array.map (fun r -> r.``Country or territory``, float r.``Score (out of 10)``) | |
|> Map.ofArray | |
let cname1 = rindex |> Array.map (fun r -> r.Country, let perc = r.``Yes, important`` | |
float perc.[..perc.Length - 2] * 0.01) | |
|> Map.ofSeq | |
let getKeys = Seq.map keyValueToKey >> set | |
let shared = Set.intersect (getKeys cname0) (getKeys cname1) | |
let data = shared |> Seq.map (fun c -> c, cname0.[c], cname1.[c]) |> Seq.toArray | |
let cs,livescore, rscore = data |> Array.unzip3 | |
shared |> Seq.map (fun c -> sprintf "%s,%A,%A" c cname0.[c] cname1.[c]) |> joinToStringWith "\n" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment