« Conan O'Brien Gathers 'Facebook Army' For Huge TV Comeback | Main | This disgusts me or maybe it just makes me sad »

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8345161cc69e20133f2b53aec970b

Listed below are links to weblogs that reference Creating Country Level Heatmaps in Python:

Comments

MaeSims

I received my first loan when I was not very old and this supported my business very much. Nevertheless, I require the collateral loan again.

sewa mobil

Nice article, thanks for the information.

Nike air max

Books and friends should be few but good.It takes three generations to make a gentleman.

coach stores

nothing is impossible for a willing heart.

coach factory stores

Wow! Great info. I wish, I could have such a writing skills.*

Trademark

Hi - just wanted to let you know that we are using a variation of your process for trademark application heatmaps. Thanks.

Chat

One of the more successful your blog writings Thank you

Chat

your effort has been successful in health care in a blog post, this guy is one of the biggest fans.. :))

Betty

Thanks a lot for this! I was looking exactly for that. While playing around with your script I found out that you can actually get rid of the whole beautifulsoup parsing / replacing stuff. You can simply put a css class in the style section for each country you want to change...

in the svg file it says:
/*
* Additional style rules
*
* The following are examples of colouring countries. You can substitute these with your own styles to colour the countries on the map.
*
* Color a few countries:
*
* .gb, .au, .nc
* {
* fill: #ff0000;
* }

so basically you your search for the closing style tag and insert a css block for each country there


stylekey="/style> "#insert opening bracket I had to remove it or your comment form strips the tag
addstyles=""

for cntry,rate in yourdatadict.iteritems():
addstyles="""%s

.%s {
fill: %s;
}
"""%(addstyles,cntry,rate_to_color(rate))
addstyles="""%s

"""%addstyles
f = open(SVGOUTFILE, "w")
f.write(svg.replace(stylekey,addstyles,1))

php web development india

I am not using python but it was nice to learn something new and python seems quite interesting to me so thanks buddy.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.

My Photo
Blog powered by TypePad

Become a Fan