Archives
Categories
Blogroll
Pages
Tags
- Ben Carson
- brainpickings
- cast iron
- cemetery
- choropleth
- Civil War
- cooking
- correlation
- css
- data
- data loss
- dave winer
- earnings
- education
- FB replacement suite
- Federal Reserve
- Gettysburg
- Google+
- hello world
- history
- Hitler
- Japan
- javascript
- Josh Brown
- liveblog
- math art
- Naked Capitalism
- NY Times
- poetry
- programming
- recession
- research
- Ritholz
- Seeking Alpha
- Snow Leopard
- statistics
- Steve Jobs
- sunrise
- SVG
- taxes
- trump
- TV
- Twilight Zone
- wall of worry
Spam Blocked
Meta
Jack ‘O’ DeathStar
One Response to Jack ‘O’ DeathStar
Leave a Reply
You must be logged in to post a comment.
Hi Amos,
I’m trying to understand your post on Nathan Yau’s choropleth map instructions:
http://flowingdata.com/2009/11/12/how-to-make-a-us-county-thematic-map-using-free-tools/
Amos Newcombe — November 16, 2009 at 3:51 pm
I ran into this too, and solved it by running the output of BeautifulSoup.prettify() through the following function:
import re
reSodipodi = re.compile(r”)
reDefs = re.compile(r”)
def CleanSoup(s):
‘Remove the problematic tags written by BeautifulSoup.’
s = reSodipodi.sub(”, s)
s = reDefs.sub(”, s)
return s
This trashes both the beginning and the end tags, which are unneeded to display the SVG.
When you say ‘run the output… through’ does that mean to include the script at the end of the program? Also, I get a syntax error for (r”). I really want it to work. I’m new to python but I think that the tags are bugging the program. Thanks.
Sincerely, Graham Selkirk