<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>PLEASE change feed URL to http://blog.ouseful.info/feed/</title>
	
	<link>http://blog.ouseful.info</link>
	<description>In the expectation that Google will axe feedburner, please change any subscriptions to this feed to http://blog.ouseful.info/feed/</description>
	<lastBuildDate>Sat, 18 May 2013 22:36:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain="blog.ouseful.info" port="80" path="/?rsscloud=notify" registerProcedure="" protocol="http-post" />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>OUseful.Info, the blog...</title>
		<link>http://blog.ouseful.info</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.ouseful.info/osd.xml" title="OUseful.Info, the blog..." />
	
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ouseful" /><feedburner:info uri="ouseful" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://blog.ouseful.info/?pushpress=hub" /><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /><feedburner:emailServiceId>ouseful</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Google Lock-In Lock-Out</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/0dpzcgX7zwg/</link>
		<comments>http://blog.ouseful.info/2013/05/16/google-lock-in/#comments</comments>
		<pubDate>Thu, 16 May 2013 18:13:34 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Anything you want]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10673</guid>
		<description>As John Naughton feels obliged to remind folk every now and again, the web is not the internet. Because we all know that for many people, Facebook apparently is. Or Google is. And as anyone following my tweets over the last year or two will know, I&amp;#8217;ve started finding Google more and more irksome. It&amp;#8217;s [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10673&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>As John Naughton feels obliged to remind folk every now and again, <a href="http://www.guardian.co.uk/technology/2010/jun/20/internet-everything-need-to-know">the web is not the internet</a>. Because we all know that for many people, Facebook apparently is. Or Google is.</p>
<p>And as anyone following my tweets over the last year or two will know, I&#8217;ve started finding Google more and more irksome.</p>
<p>It&#8217;s not just that the one or two people I know who use Google Plus (Google+?) are now all but lost to me as sources of neat ideas because I don&#8217;t do Gooplus and it doesn&#8217;t do RSS&#8230;</p>
<p>It&#8217;s not just because Google is shutting down the Google Reader backbone that powers a lot of RSS and Atom syndication feed services (and leaves me wondering: how long is Feedburner for this world? Maybe it&#8217;s time to start moving your feeds and trying to get folk off that piece of infrastructure&#8230;)&#8230;</p>
<p>It&#8217;s not just that <a href="https://support.google.com/fusiontables/answer/171215?hl=en&amp;ref_topic=27017">geocoding done within Fusion Tables is not exported</a> &#8211; if you look at a KML feed from Google Fusion Tables, you&#8217;ll find there&#8217;s no lat-long data there. To get a geo-view, you need to stick in Google Fusion Tables or wire the feed into Google Earth, which will then &#8220;initiate geocoding of location descriptions while viewing [the] KML file&#8221;&#8230;</p>
<p>It&#8217;s not just that Google is <a href="http://support.google.com/drive/bin/answer.py?hl=en&amp;answer=2791335&amp;ctx=cb&amp;src=cb&amp;cbid=-au8fo9d68c25&amp;cbrank=0">deprecating gadgets from spreadsheets</a>, which as Martin points out means that <a href="http://mashe.hawksey.info/2013/05/punchcard-charts-in-google-sheets/">if I want to visualise data in a spreadsheet all I’m going to be left with is Google’s crappy charts</a>&#8230;</p>
<p>It&#8217;s not just that <a href="https://developers.google.com/google-apps/calendar/caldav">Google moved away from using CalDav</a> to support calendar interoperability&#8230;</p>
<p>It&#8217;s not just that <a href="https://news.ycombinator.com/item?id=5714557">Google is moving away from using the XMPP instant messaging protocol</a> (and <a href="http://mqtt.org/2011/08/mqtt-and-android-make-great-partners">nor</a>, I think, making a move towards using <a href="http://bits.blogs.nytimes.com/2013/04/25/a-messenger-for-the-internet-of-things/">MQTT</a>?)&#8230;</p>
<p>It&#8217;s not just that Google will be using your photos to create <a href="http://www.tomshardware.com/news/google-io-auto-awesome-photo-enhancement-highlights,22602.html">photos you never took</a> and presumably offer them up via your image gallery in favour of photos it thinks aren&#8217;t up to scratch&#8230;</p>
<p>Though I&#8217;m sure that Google wouldn&#8217;t start pushing images in <em>just</em> the <a href="http://www.webmonkey.com/2013/03/put-your-site-on-a-diet-with-googles-image-shrinking-webp-format/">WebP image format</a> so that you&#8217;d feel obliged to use Chrome&#8230;</p>
<p><em>And also in the browser, I&#8217;m sure Google wouldn&#8217;t start using <a href="https://developers.google.com/speed/public-dns/">Google Public DNS</a> as a Chrome default setting. (Is the same true of Chromebook? Presumably folk connected to <a href="https://fiber.google.com/about/">Google Fiber</a> use Google Public DNS?) But does it use <a href="http://blog.chromium.org/2012/01/making-web-speedier-and-safer-with-spdy.html">SPDY as a default</a>? How about <a href="http://blog.chromium.org/2013/03/data-compression-in-chrome-beta-for.html">on Android</a>?</em></p>
<p>It&#8217;s not just that <a href="http://www.technologyreview.com/news/514836/googles-social-network-gets-smarter/">Google will tag your social media posts</a> using tags you might never use yourself, and as it does so altering the externalised memory embodied by that post&#8230;</p>
<p>It&#8217;s not just that as web search gets increasingly personalised and localised, we lose any sense of <a href="http://blog.ouseful.info/2011/06/21/filter-bubbles-google-ground-truth-and-twitter-echochambers/">Google ground truth</a>; I&#8217;m not quite sure how the info-skills trainers are going to address this when training a motley crew of different learners to discover a particular resource other than by using known-item search strategies (which sort of misses the point). Or maybe it&#8217;s right that a cohort of students should all get different results when they run ostensibly the same search?</p>
<p><em>Hmmm.. thinks: if personalised/localised search could be reduced to raw search phrase (whatever I put in the search box) plus a set of invisible search limits that reflect the personalisation/localisation tweaks applied to my search, how might my hidden/invisible search limits compare with yours?</em></p>
<p>It&#8217;s not just that Google uses <a href="http://uk.reuters.com/article/2013/05/01/uk-tax-uk-google-specialreport-idUKBRE94005R20130501">tax efficient corporate structures</a> to <a href="http://www.parliamentlive.tv/Main/Player.aspx?meetingId=13138">minimise its tax bill</a>, because lots of companies do that&#8230;</p>
<p>It&#8217;s not just any one of these things, taken on its own merits&#8230; it&#8217;s all of them taken together&#8230;</p>
<p><em>&#8220;Embrace, extend, extinguish&#8221;</em>&#8230; where have we heard that before?</p>
<p>Drip; drip; drip&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10673/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10673/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10673&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=0dpzcgX7zwg:JrSxjvn08S0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0dpzcgX7zwg:JrSxjvn08S0:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0dpzcgX7zwg:JrSxjvn08S0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=0dpzcgX7zwg:JrSxjvn08S0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0dpzcgX7zwg:JrSxjvn08S0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=0dpzcgX7zwg:JrSxjvn08S0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0dpzcgX7zwg:JrSxjvn08S0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=0dpzcgX7zwg:JrSxjvn08S0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0dpzcgX7zwg:JrSxjvn08S0:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/0dpzcgX7zwg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/16/google-lock-in/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/16/google-lock-in/</feedburner:origLink></item>
		<item>
		<title>Asking Questions of Data Contained in a Google Spreadsheet Using a Basic Structured Query Language</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/lKJ-EdaXBRk/</link>
		<comments>http://blog.ouseful.info/2013/05/15/asking-questions-of-data-contained-in-a-google-spreadsheet-using-a-basic-structured-query-language/#comments</comments>
		<pubDate>Wed, 15 May 2013 10:00:53 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Infoskills]]></category>
		<category><![CDATA[School_Of_Data]]></category>
		<category><![CDATA[gspreadsheets]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10652</guid>
		<description>There is an old saying along the lines of &amp;#8220;give a man a fish and you can feed him for a day; teach a man to fish and you&amp;#8217;ll feed him for a lifetime&amp;#8221;. The same is true when you learn a little bit about structure queries languages&amp;#8230; In the post Asking Questions of Data [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10652&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>There is an old saying along the lines of &#8220;give a man a fish and you can feed him for a day; teach a man to fish and you&#8217;ll feed him for a lifetime&#8221;. The same is true when you learn a little bit about structure queries languages&#8230; In the post <a href="http://schoolofdata.org/2013/05/13/asking-questions-of-data-some-simple-one-liners/">Asking Questions of Data – Some Simple One-Liners</a>, we can see how the SQL query language could be used to ask questions of an election related dataset hosted on Scraperwiki that had been compiled by scraping a &#8220;Notice of Poll&#8221; PDF document containing information about election candidates. In this post, we&#8217;ll see how a series of queries constructed along very similar lines can be applied to data contained within a Google spreadsheet using the <a href="https://developers.google.com/chart/interactive/docs/querylanguage">Google Chart Tools Query Language</a>.</p>
<p>To provide some sort of context, I&#8217;ll stick with the local election theme, although in this case the focus will be on <em>election results</em> data. If you want to follow along, the data can be found in this Google spreadsheet &#8211; <a href="https://docs.google.com/spreadsheet/ccc?key=0AirrQecc6H_vdEZOZ21sNHpibnhmaEYxbW96dkNxZGc&amp;usp=sharing">Isle of Wight local election data results, May 2013</a> (the spreadsheet key is <tt>0AirrQecc6H_vdEZOZ21sNHpibnhmaEYxbW96dkNxZGc</tt>).</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/iw-poll-spreadsheet.png"><img src="http://ouseful.files.wordpress.com/2013/05/iw-poll-spreadsheet.png?w=700&#038;h=380" alt="IW Poll spreadsheet" width="700" height="380" class="alignnone size-full wp-image-10653" /></a></p>
<p>The data was obtained from <a href="http://onthewight.com/2013/05/03/isle-of-wight-election-results-2013-the-detail/">a dataset originally published by the OnTheWight hyperlocal blog</a> that was shaped and cleaned using OpenRefine using a data wrangling recipe similar to the one described in <a href="http://blog.ouseful.info/2013/05/03/a-wrangling-example-with-openrefine-making-ready-data/">A Wrangling Example With OpenRefine: Making “Oven Ready Data”</a>.</p>
<p>To query the data, I&#8217;ve popped up a simple query form on Scraperwiki: <a href="https://views.scraperwiki.com/run/google_spreadsheet_query/">Google Spreadsheet Explorer</a></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/google-spreadsheet-explorer.png"><img src="http://ouseful.files.wordpress.com/2013/05/google-spreadsheet-explorer.png?w=700&#038;h=470" alt="Google spreadsheet explorer" width="700" height="470" class="alignnone size-full wp-image-10654" /></a></p>
<p>To use the explorer, you need to:</p>
<ol>
<li>provide a spreadsheet key value and optional sheet number (for example, <tt>0AirrQecc6H_vdEZOZ21sNHpibnhmaEYxbW96dkNxZGc</tt>);</li>
<li>preview the table headings;</li>
<li>construct a query using the column letters;</li>
<li>select the output format;</li>
<li>run the query.</li>
</ol>
<p>So what sort of questions might we want to ask of the data? Let&#8217;s build some up.</p>
<p>We might start by just looking at the raw results as they come out of the spreadsheet-as-database: <tt>SELECT A,D,E,F</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/simple-query1.png"><img src="http://ouseful.files.wordpress.com/2013/05/simple-query1.png?w=700&#038;h=377" alt="SImple query" width="700" height="377" class="alignnone size-full wp-image-10666" /></a></p>
<p>We might then want to look at each electoral division seeing the results in rank order: <tt>SELECT A,D,E,F WHERE E != 'NA' ORDER BY A,F DESC</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/results-in-order1.png"><img src="http://ouseful.files.wordpress.com/2013/05/results-in-order1.png?w=700&#038;h=352" alt="Results in order" width="700" height="352" class="alignnone size-full wp-image-10667" /></a></p>
<p>Let&#8217;s bring the spoiled vote count back in: <tt>SELECT A,D,E,F WHERE E != 'NA' OR D CONTAINS 'spoil'  ORDER BY A,F DESC</tt> (we might equally have said <tt>OR D = 'Papers spoilt'</tt>).</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/papers-spoilt-included.png"><img src="http://ouseful.files.wordpress.com/2013/05/papers-spoilt-included.png?w=700&#038;h=415" alt="Papers spoilt included" width="700" height="415" class="alignnone size-full wp-image-10662" /></a></p>
<p>How about doing some sums? How does the league table of postal ballot percentages look across each electoral division? <tt>SELECT A,100*F/B WHERE D CONTAINS 'Postal' ORDER BY 100*F/B DESC</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/postal-turnout.png"><img src="http://ouseful.files.wordpress.com/2013/05/postal-turnout.png?w=700&#038;h=314" alt="Postal Turnout" width="700" height="314" class="alignnone size-full wp-image-10659" /></a></p>
<p>Suppose we want to look at the turnout. The &#8220;NoONRoll&#8221; column B gives the number of people eligible to vote in each electoral division, which is a good start. Unfortunately, using the data in the spreadsheet we have, we can&#8217;t do this for all electoral divisions &#8211; the &#8220;votes cast&#8221; is not necessarily the number of people who voted because some electoral divisions (Brading, St Helens &amp; Bembridge and Nettlestone &amp; Seaview) returned <em>two</em> candidates (which meant people voting were each allowed to cast up to an including two votes; the number of people who voted was in the original OnTheWight dataset). If we bear this <em>caveat</em> in mind, we can run the number for the other electoral divisions though. The <tt>Total votes cast</tt> is actually the number of &#8220;good&#8221; votes cast &#8211; the turnout was actually the <tt>Total votes cast</tt> <em>plus</em> the <tt>Papers spoilt</tt>. Let&#8217;s start by calculating the &#8220;good vote turnout&#8221; for each ward, rank the electoral divisions by turnout (<tt>ORDER BY 100*F/B DESC</tt>), label the turnout column appropriately (<tt>LABEL 100*F/B 'Percentage'</tt>) and format the results (<tt> FORMAT 100*F/B '#,#0.0'</tt>) using the query <tt>SELECT A, 100*F/B WHERE D CONTAINS 'Total' ORDER BY 100*F/B DESC LABEL 100*F/B 'Percentage' FORMAT 100*F/B '#,#0.0'</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/good-vote-turnout.png"><img src="http://ouseful.files.wordpress.com/2013/05/good-vote-turnout.png?w=700&#038;h=369" alt="Good vote turnout" width="700" height="369" class="alignnone size-full wp-image-10661" /></a></p>
<p>Remember, the first two results are &#8220;nonsense&#8221; because electors in those electoral divisions may have cast two votes.</p>
<p>How about the three electoral divisions with the lowest turn out? <tt>SELECT A, 100*F/B WHERE D CONTAINS 'Total' ORDER BY 100*F/B ASC LIMIT 3 LABEL 100*F/B 'Percentage' FORMAT 100*F/B '#,#0.0'</tt> (Note that the order of the arguments &#8211; such as where to put the <tt>LIMIT</tt> &#8211; is important; the wrong order can prevent the query from running&#8230;</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/worst-3-by-turnout.png"><img src="http://ouseful.files.wordpress.com/2013/05/worst-3-by-turnout.png?w=700&#038;h=272" alt="Worst 3 by turnout" width="700" height="272" class="alignnone size-full wp-image-10669" /></a></p>
<p>The actual turn out (again, with the caveat in mind!) is the total votes cast plus the spoilt papers. To calculate this percentage, we need to sum the total and spoilt contributions in each electoral division and divide by the size of the electoral roll. To do this, we need to SUM the corresponding quantities in each electoral division. Because multiple (two) rows are summed for each electoral division, we find the size of the electoral roll in each electoral division as SUM(B)/COUNT(B) &#8211; that is, we count it twice and divide by the number of times we counted it. The query (without tidying) starts off looking like this: <tt>SELECT A,SUM(F)*COUNT(B)/SUM(B) WHERE D CONTAINS 'Total' OR D CONTAINS 'spoil' GROUP BY A</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/summing-rows-in-a-group.png"><img src="http://ouseful.files.wordpress.com/2013/05/summing-rows-in-a-group.png?w=700&#038;h=333" alt="Summing rows in a group" width="700" height="333" class="alignnone size-full wp-image-10660" /></a></p>
<p>In terms of popularity, who were the top 5 candidates in terms of people receiving the largest number of votes? <tt>SELECT D,A, E, F WHERE E!='NA' ORDER BY F DESC LIMIT 5</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/top-5-by-votes-cast.png"><img src="http://ouseful.files.wordpress.com/2013/05/top-5-by-votes-cast.png?w=700&#038;h=295" alt="Top 5 by votes cast" width="700" height="295" class="alignnone size-full wp-image-10658" /></a></p>
<p>How about if we normalise these numbers by the number of people on the electoral roll in the corresponding areas &#8211; <tt>SELECT D,A, E, F/B WHERE E!='NA' ORDER BY F/B DESC LIMIT 5</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/top-5-as-percentage-on-roll.png"><img src="http://ouseful.files.wordpress.com/2013/05/top-5-as-percentage-on-roll.png?w=700&#038;h=291" alt="TOp 5 as percentage on roll" width="700" height="291" class="alignnone size-full wp-image-10657" /></a></p>
<p>Looking at the parties, how did the sum of their votes across all the electoral divisions compare? <tt>SELECT E,SUM(F) where E!='NA' GROUP BY E ORDER BY SUM(F) DESC</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/votes-by-party.png"><img src="http://ouseful.files.wordpress.com/2013/05/votes-by-party.png?w=700&#038;h=380" alt="VOtes by party" width="700" height="380" class="alignnone size-full wp-image-10656" /></a></p>
<p>How about if we bring in the number of candidates who stood for each party, and normalise by this to calculate the average &#8220;votes per candidate&#8221; by party? <tt>SELECT E,SUM(F),COUNT(F), SUM(F)/COUNT(F) where E!='NA' GROUP BY E ORDER BY SUM(F)/COUNT(F) DESC</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/average-votes-per-candidate.png"><img src="http://ouseful.files.wordpress.com/2013/05/average-votes-per-candidate.png?w=700&#038;h=319" alt="Average votes per candidate" width="700" height="319" class="alignnone size-full wp-image-10655" /></a></p>
<p>To summarise then, in this post, we have seen how we can use a structured query language to interrogate the data contained in a Google Spreadsheet, essentially treating the Google Spreadsheet as if it were a database. The query language can also be used to to perform a series of simple calculations over the data to produce a derived dataset. Unfortunately, the query language does not allow us to nest SELECT statements in the same way we can nest SQL SELECT statements, which limits some of the queries we can run.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10652/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10652/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10652&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=lKJ-EdaXBRk:8FJpZf_XL6c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=lKJ-EdaXBRk:8FJpZf_XL6c:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=lKJ-EdaXBRk:8FJpZf_XL6c:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=lKJ-EdaXBRk:8FJpZf_XL6c:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=lKJ-EdaXBRk:8FJpZf_XL6c:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=lKJ-EdaXBRk:8FJpZf_XL6c:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=lKJ-EdaXBRk:8FJpZf_XL6c:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=lKJ-EdaXBRk:8FJpZf_XL6c:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=lKJ-EdaXBRk:8FJpZf_XL6c:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/lKJ-EdaXBRk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/15/asking-questions-of-data-contained-in-a-google-spreadsheet-using-a-basic-structured-query-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/iw-poll-spreadsheet.png" medium="image">
			<media:title type="html">IW Poll spreadsheet</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/google-spreadsheet-explorer.png" medium="image">
			<media:title type="html">Google spreadsheet explorer</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/simple-query1.png" medium="image">
			<media:title type="html">SImple query</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/results-in-order1.png" medium="image">
			<media:title type="html">Results in order</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/papers-spoilt-included.png" medium="image">
			<media:title type="html">Papers spoilt included</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/postal-turnout.png" medium="image">
			<media:title type="html">Postal Turnout</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/good-vote-turnout.png" medium="image">
			<media:title type="html">Good vote turnout</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/worst-3-by-turnout.png" medium="image">
			<media:title type="html">Worst 3 by turnout</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/summing-rows-in-a-group.png" medium="image">
			<media:title type="html">Summing rows in a group</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/top-5-by-votes-cast.png" medium="image">
			<media:title type="html">Top 5 by votes cast</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/top-5-as-percentage-on-roll.png" medium="image">
			<media:title type="html">TOp 5 as percentage on roll</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/votes-by-party.png" medium="image">
			<media:title type="html">VOtes by party</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/average-votes-per-candidate.png" medium="image">
			<media:title type="html">Average votes per candidate</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/15/asking-questions-of-data-contained-in-a-google-spreadsheet-using-a-basic-structured-query-language/</feedburner:origLink></item>
		<item>
		<title>To What Extent Do Candidates Support Each Other Redux – A One-Liner, Thirty Second Route to the Info</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/_RLgydzIRCM/</link>
		<comments>http://blog.ouseful.info/2013/05/08/to-what-extent-do-candidates-support-each-other-redux-a-one-liner-thirty-second-route-to-the-info/#comments</comments>
		<pubDate>Wed, 08 May 2013 10:50:40 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[schoolofdata]]></category>
		<category><![CDATA[scraperwiki]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10643</guid>
		<description>In More Storyhunting Around Local Elections Data Using Gephi – To What Extent Do Candidates Support Each Other? I described a visual route to finding out which local council candidates had supported each other on their nomination papers. There is also a thirty second route to that data that I should probably have mentioned;-) From [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10643&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>In <a href="http://blog.ouseful.info/2013/05/08/more-storyhunting-around-local-elections-data-using-gephi-to-what-extent-do-candidates-support-each-other/">More Storyhunting Around Local Elections Data Using Gephi – To What Extent Do Candidates Support Each Other?</a> I described a visual route to finding out which local council candidates had supported each other on their nomination papers. There is also a thirty second route to that data that I should probably have mentioned;-)</p>
<p>From the <a href="https://scraperwiki.com/scrapers/iw_poll_notices_scrape/">Scraperwiki database</a>, we need to interrogate the API:</p>
<p><a href="https://scraperwiki.com/scrapers/iw_poll_notices_scrape/"><img src="http://ouseful.files.wordpress.com/2013/05/scraperwiki-api.png?w=700" alt="scraperwiki api"   class="alignnone size-full wp-image-10645" /></a></p>
<p>To do this, we&#8217;ll use a database query language &#8211; SQL.</p>
<p>What we need to ask the database is which of the assentors (members of the <em>support</em> column) are also candidates (members of the <em>candinit</em> column, and just return those rows. The SQL command is simply this:</p>
<p><tt>select * from support where support in (select candinit from support)</tt></p>
<p>Note that &#8220;support&#8221; refers to two things here &#8211; these are columns:</p>
<p><tt>select <strong>*</strong> from support where <strong>support</strong> in (select <strong>candinit</strong> from support)</tt></p>
<p>and these are the table the columns are being pulled from:</p>
<p><tt>select * from <strong>support</strong> where support in (select candinit from <strong>support</strong>)</tt></p>
<p>Here&#8217;s the result of <em>Run</em>ing the query:</p>
<p><a href="https://scraperwiki.com/docs/api?name=iw_poll_notices_scrape#sqlite"><img src="http://ouseful.files.wordpress.com/2013/05/sql-select-on-scraperwiki.png?w=700" alt="sql select on scraperwiki"   class="alignnone size-full wp-image-10644" /></a></p>
<p>We can also get a <a href="https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=htmltable&amp;name=iw_poll_notices_scrape&amp;query=select%20*%20from%20%60support%60%20where%20support%20in%20(select%20candinit%20from%20support)">direct link to a tabular view of the data</a> (or generate a link to a CSV output etc from the <em>format</em> selector).</p>
<p><a href="https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=htmltable&amp;name=iw_poll_notices_scrape&amp;query=select%20*%20from%20%60support%60%20where%20support%20in%20(select%20candinit%20from%20support)"><img src="http://ouseful.files.wordpress.com/2013/05/candidates-mutual-table.png?w=700&#038;h=241" alt="candidates mutual table" width="700" height="241" class="alignnone size-full wp-image-10646" /></a></p>
<p>There are 15 rows in this result compared to the 15 edges/connecting lines discovered in the Gephi approach, so each method corroborates the other:</p>
<p><a href="http://blog.ouseful.info/2013/05/08/more-storyhunting-around-local-elections-data-using-gephi-to-what-extent-do-candidates-support-each-other/"><img src="http://ouseful.files.wordpress.com/2013/05/tidier-intra-candidate-support-map.png?w=700&#038;h=618" alt="Tidier intra-candidate support map" width="700" height="618" class="alignnone size-full wp-image-10602" /></a></p>
<p>Simples:-)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10643/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10643&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=_RLgydzIRCM:8GF5KMGFZSs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=_RLgydzIRCM:8GF5KMGFZSs:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=_RLgydzIRCM:8GF5KMGFZSs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=_RLgydzIRCM:8GF5KMGFZSs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=_RLgydzIRCM:8GF5KMGFZSs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=_RLgydzIRCM:8GF5KMGFZSs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=_RLgydzIRCM:8GF5KMGFZSs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=_RLgydzIRCM:8GF5KMGFZSs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=_RLgydzIRCM:8GF5KMGFZSs:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/_RLgydzIRCM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/08/to-what-extent-do-candidates-support-each-other-redux-a-one-liner-thirty-second-route-to-the-info/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/scraperwiki-api.png" medium="image">
			<media:title type="html">scraperwiki api</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/sql-select-on-scraperwiki.png" medium="image">
			<media:title type="html">sql select on scraperwiki</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/candidates-mutual-table.png" medium="image">
			<media:title type="html">candidates mutual table</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/tidier-intra-candidate-support-map.png" medium="image">
			<media:title type="html">Tidier intra-candidate support map</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/08/to-what-extent-do-candidates-support-each-other-redux-a-one-liner-thirty-second-route-to-the-info/</feedburner:origLink></item>
		<item>
		<title>More Storyhunting Around Local Elections Data Using Gephi – To What Extent Do Candidates Support Each Other?</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/ef_n0ke3NZQ/</link>
		<comments>http://blog.ouseful.info/2013/05/08/more-storyhunting-around-local-elections-data-using-gephi-to-what-extent-do-candidates-support-each-other/#comments</comments>
		<pubDate>Wed, 08 May 2013 09:05:06 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[gephi]]></category>
		<category><![CDATA[schoolofdata]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10599</guid>
		<description>In Questioning Election Data to See if It Has a Story to Tell I started to explore various ways in which we could start to search for stories in a dataset finessed out of a set of poll notices announcing the recent Isle of Wight Council elections. In this post, I&amp;#8217;ll do a little more [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10599&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>In <a href="http://blog.ouseful.info/2013/05/05/questioning-election-data-to-see-if-it-has-a-story-to-tell/">Questioning Election Data to See if It Has a Story to Tell</a> I started to explore various ways in which we could start to search for stories in a dataset finessed out of a set of poll notices announcing the recent Isle of Wight Council elections. In this post, I&#8217;ll do a little more questioning, especially around the assentors (proposers, seconders etc) who supported each candidate, looking to see whether there are any social structures in there resulting from candidates supporting each others&#8217; applications. The essence of what we&#8217;re doing is some simple social network analysis around the candidate/assentor network. (For an alternative route to the result, see <a href="http://blog.ouseful.info/2013/05/08/to-what-extent-do-candidates-support-each-other-redux-a-one-liner-thirty-second-route-to-the-info/">To What Extent Do Candidates Support Each Other Redux – A One-Liner, Thirty Second Route to the Info</a>.)</p>
<p>This is what we&#8217;ll be working towards:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/tidier-intra-candidate-support-map.png"><img src="http://ouseful.files.wordpress.com/2013/05/tidier-intra-candidate-support-map.png?w=700&#038;h=618" alt="Tidier intra-candidate support map" width="700" height="618" class="alignnone size-full wp-image-10602" /></a></p>
<p>If you want to play along, you can get the data from my <a href="https://scraperwiki.com/scrapers/iw_poll_notices_scrape/">IW poll notices scrape</a> on ScraperWiki, specifically the <em>support</em> table.</p>
<p><a href="https://scraperwiki.com/scrapers/iw_poll_notices_scrape/"><img src="http://ouseful.files.wordpress.com/2013/05/scraperwiki-council-elections-assentors.png?w=700&#038;h=275" alt="scraperwiki council elections - assentors" width="700" height="275" class="alignnone size-full wp-image-10620" /></a></p>
<p>Here&#8217;s a reminder of what the <a href="http://www.iwight.com/azservices/documents/1174-Notice%20of%20Poll%20-%20IOWC%20May%202013.pdf">original PDF</a> doc looked like (<a href="https://dl.dropboxusercontent.com/u/1156404/1174-Notice%20of%20Poll%20-%20IOWC%20May%202013.pdf">archive copy</a>):</p>
<p><a href="http://www.iwight.com/azservices/documents/1174-Notice%20of%20Poll%20-%20IOWC%20May%202013.pdf"><img src="http://ouseful.files.wordpress.com/2013/05/iw-poll-notice-assentors.png?w=700&#038;h=538" alt="IW poll notice assentors" width="700" height="538" class="alignnone size-full wp-image-10619" /></a></p>
<p>Checking the extent to which candidates supported each other is something we could do by hand, looking down each candidate&#8217;s list of  assentors for names of other candidates, but it would be a laborious job. It&#8217;s far easier(?!;-) to automate it&#8230;</p>
<p>When we want to compare names using a computer programme or script, the simplest approach is to do an <strong>exact string match</strong> (a <em>string</em> is a list of characters). Two strings match if they are exactly the same, so for example: <em>This string</em> is the same as <em>This string</em>, but not <em>this string</em> (they differ in their first character &#8211; upper case <em>T</em> in the first example as compared with lower case <em>t</em> in the last. We&#8217;ll be using exact string matching to identify whether a candidate has the same name as any of the assentors, so on the scraper, I did a little fiddling around with the names, in particular generating a new column that recasts the name of the candidate into the same presentation form used to identify the assentors (<em>Firstname I. Lastname</em>).</p>
<p>We can download a <a href="https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=csv&amp;name=iw_poll_notices_scrape&amp;query=select+*+from+`support`&amp;apikey=">CSV representation of the data</a> from the scraper directly:</p>
<p><a href="https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=csv&amp;name=iw_poll_notices_scrape&amp;query=select+*+from+`support`&amp;apikey="><img src="http://ouseful.files.wordpress.com/2013/05/scraperwiki-csv-download.png?w=700" alt="Scraperwiki CSV download"   class="alignnone size-full wp-image-10626" /></a></p>
<p>The first thing I want to explore is the extent to which candidates support other candidates to see if we can identify any political groupings. The tool I&#8217;m going to use to visualise the data is Gephi, an open-source cross-platform application (requires Java) that you can download for free from <a href="http://gephi.org">gephi.org</a>.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/gephi-org.png"><img src="http://ouseful.files.wordpress.com/2013/05/gephi-org.png?w=700&#038;h=337" alt="Gephi.org" width="700" height="337" class="alignnone size-full wp-image-10622" /></a></p>
<p>To view the data in Gephi, it&#8217;s easiest if we rename a couple of columns so that Gephi can recognise relations between supporters and candidates; if we open the CSV download file in a text editor, we can rename the <em>candinit</em> as <em>target</em> and the <em></em> column as <em>Source</em> to represent an arrow going from an assentor to a candidate, where the arrow reads something along the lines of &#8220;is a supporter of&#8221;.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/csv-rename.png"><img src="http://ouseful.files.wordpress.com/2013/05/csv-rename.png?w=700" alt="csv rename"   class="alignnone size-full wp-image-10618" /></a></p>
<p>Start Gephi, select Data Laboratory tab and then New Project from the File menu.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/geohi-data-lab-new-project.png"><img src="http://ouseful.files.wordpress.com/2013/05/geohi-data-lab-new-project.png?w=700&#038;h=279" alt="geohi data lab new project" width="700" height="279" class="alignnone size-full wp-image-10617" /></a></p>
<p>You should now see a toolbar that includes an &#8220;Import Spreadsheet option&#8221;:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/gephi-import-spreadsheet.png"><img src="http://ouseful.files.wordpress.com/2013/05/gephi-import-spreadsheet.png?w=700&#038;h=49" alt="gephi import spreadsheet" width="700" height="49" class="alignnone size-full wp-image-10616" /></a></p>
<p>Import the CSV file as such, identifying it as an <em>Edges Table</em>:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/import-data-into-gephi-ata-laboaratory.png"><img src="http://ouseful.files.wordpress.com/2013/05/import-data-into-gephi-ata-laboaratory.png?w=700" alt="import data into gephi data laboaratory"   class="alignnone size-full wp-image-10615" /></a></p>
<p>You should notice that the Source and Target columns have been identified as such and we have the choice to import the other column or not &#8211; let&#8217;s bring them in&#8230;</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/source-and-target-recognised.png"><img src="http://ouseful.files.wordpress.com/2013/05/source-and-target-recognised.png?w=700" alt="SOurce and Target recognised"   class="alignnone size-full wp-image-10614" /></a></p>
<p>You should now see the data has been loaded in to Gephi&#8230;</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/data-loaded-in.png"><img src="http://ouseful.files.wordpress.com/2013/05/data-loaded-in.png?w=700" alt="Data loaded in"   class="alignnone size-full wp-image-10613" /></a></p>
<p>If you click on the <em>Overview</em> tab button, you should see a mass of nodes/circles representing candidates and assentors with arrows going from assentors to candidates.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/mess1.png"><img src="http://ouseful.files.wordpress.com/2013/05/mess1.png?w=700" alt="mess..."   class="alignnone size-full wp-image-10628" /></a></p>
<p>Let&#8217;s see how they connect &#8211; we can <em>Run</em> the <em>Force Atlas 2</em> <strong>Layout</strong> algorithm for starters. I tweaked the <em>Scaling</em> value and ticked on <em>Stronger Gravity</em> to help shape the resulting layout:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/force-layout-tweaks.png"><img src="http://ouseful.files.wordpress.com/2013/05/force-layout-tweaks.png?w=700&#038;h=492" alt="force layout tweaks" width="700" height="492" class="alignnone size-full wp-image-10611" /></a></p>
<p>If you look closely, you&#8217;ll be able to see that there are many separate groupings of connected circles  &#8211; this represent candidates who are supported by folk who are not also candidates (sometimes a node sits on top of a line so it looks as if two noes are connected when in fact they aren&#8217;t&#8230;)</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/close-up-simple-patterns1.png"><img src="http://ouseful.files.wordpress.com/2013/05/close-up-simple-patterns1.png?w=700" alt="Close up simple patterns"   class="alignnone size-full wp-image-10629" /></a></p>
<p>However, there are also other groupings in which one candidate may support another:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/candidate-support1.png"><img src="http://ouseful.files.wordpress.com/2013/05/candidate-support1.png?w=700" alt="candidate support"   class="alignnone size-full wp-image-10630" /></a></p>
<p>These connections may allow us to see grouping of candidates supporting each other along party lines.</p>
<p>One of the powerful things about Gephi is that it allows us to construct quite complex, nested filters that we can apply to the data based on the properties of the network the data describes so that we can focus on particular aspects of the network I&#8217;m going to filter the network so that it shows only those individuals who are supported by at least one person (in-degree 1 or more) <em>and</em> who support at least one person (out-degree one or more) &#8211; that is, folk who are candidates (in-degree 1 or more) who also supported (oit degree 1 or more) another candidate. Let&#8217;s also turn labels on to see which candidates the filter identifies, and colour the edges along party lines. We can now see some information about the connectedness a little more clearly:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/lots-going-on.png"><img src="http://ouseful.files.wordpress.com/2013/05/lots-going-on.png?w=700&#038;h=483" alt="lots going on" width="700" height="483" class="alignnone size-full wp-image-10608" /></a></p>
<p>Hmmm.. how about if we extend out filter to see who&#8217;s connected to these nodes (this might include other candidates who do not themselves assent to another candidate), and also rezise the nodes/labels so we can better see the candidates&#8217; names. The Neigbours Network filter takes the nodes we have and then also finds the nodes that are connected to them to depth 2 in this case (that is, it brings in nodes connected to the candidates who are also supporters (depth 1), and the nodes connected to those nodes (depth two). Which is to say, it will being in the candidates who are supported by candidates, and their supporters:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/a-few-more-tweaks.png"><img src="http://ouseful.files.wordpress.com/2013/05/a-few-more-tweaks.png?w=700&#038;h=401" alt="A few more tweaks" width="700" height="401" class="alignnone size-full wp-image-10607" /></a></p>
<p>That&#8217;s a bit clearer, but there are still overlapping lines, so it may make sense to layout the network again:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/improve-the-layout.png"><img src="http://ouseful.files.wordpress.com/2013/05/improve-the-layout.png?w=700&#038;h=390" alt="improve the layout" width="700" height="390" class="alignnone size-full wp-image-10606" /></a></p>
<p>We can also experiment with other colourings &#8211; if we go to the Statistics panel, we can run a <em>Connected Components</em> filter that tries to find nodes that are connected into distinct groups. We can then colour each of the separate groups uniquely:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/colour-the-groups.png"><img src="http://ouseful.files.wordpress.com/2013/05/colour-the-groups.png?w=700&#038;h=410" alt="colour the groups" width="700" height="410" class="alignnone size-full wp-image-10634" /></a></p>
<p>Let&#8217;s reset the colours and go back to colourings along party lines:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/gephi-reset-colours.png"><img src="http://ouseful.files.wordpress.com/2013/05/gephi-reset-colours.png?w=700" alt="Gephi reset colours"   class="alignnone size-full wp-image-10633" /></a></p>
<p>If we go to the <em>Preview</em> view, we can generate a prettified view of the network:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/preview-layout.png"><img src="http://ouseful.files.wordpress.com/2013/05/preview-layout.png?w=700&#038;h=450" alt="Preview layout" width="700" height="450" class="alignnone size-full wp-image-10605" /></a></p>
<p>In it, we can clearly see groupings along party lines (inside the blue boxes). There is something odd, though? There appears to be a connection between UKIP and Independent groupings? Let&#8217;s zoom in:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/this-is-odd.png"><img src="http://ouseful.files.wordpress.com/2013/05/this-is-odd.png?w=700" alt="this is odd"   class="alignnone size-full wp-image-10604" /></a></p>
<p>Going back to the Graph view and zooming in, we see that <em>Paul G. taylor</em> appears to be supporting two candidates of different parties&#8230; Hmm &#8211; I wonder: are there actually <em>two</em> Paul G. Taylors, I wonder, with different political preferences? (Note to self: check on Electoral Commission website what regulations there are about assenting. Can you only assent to one person, and then only within the ward in which you are registered to vote? For local elections, could you be registered to vote in more than one electoral division within the same council area?)</p>
<p>To check that there are no other names that support more than one candidate, we can create another, simple filter that just selects nodes with out-degree 2 or more &#8211; that is, who support 2 or more other nodes:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/filter-on-nodes-out-degree-2.png"><img src="http://ouseful.files.wordpress.com/2013/05/filter-on-nodes-out-degree-2.png?w=700" alt="Filter on nodes out degree 2"   class="alignnone size-full wp-image-10600" /></a></p>
<p>Just that one then&#8230;</p>
<p>Looking at the fuller chart, it&#8217;s still rather scruffy. We could tidy it by removing assentors who are not themselves candidates (that is, there are no arrows pointing in to them). The way Gephi filters work support chaining. If you look at the filters, you will see they are nested, much like a nested comment thread in a forum. Filters at the bottom of the tree act on the graph and pass the filtereed network to date up the tree to the next filter. This means we can pass the network as shown above into another filter layer that removes folk who are &#8220;just&#8221; assentors and not candidates.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/nested-filters.png"><img src="http://ouseful.files.wordpress.com/2013/05/nested-filters.png?w=700" alt="nested filters"   class="alignnone size-full wp-image-10601" /></a></p>
<p>Here&#8217;s the result:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/nesting-filters-in-gephi.png"><img src="http://ouseful.files.wordpress.com/2013/05/nesting-filters-in-gephi.png?w=700&#038;h=396" alt="Nesting filters in gephi" width="700" height="396" class="alignnone size-full wp-image-10603" /></a></p>
<p>And again we can go into Preview mode to generate a nice vectorised version of the graph:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/tidier-intra-candidate-support-map.png"><img src="http://ouseful.files.wordpress.com/2013/05/tidier-intra-candidate-support-map.png?w=700&#038;h=618" alt="Tidier intra-candidate support map" width="700" height="618" class="alignnone size-full wp-image-10602" /></a></p>
<p>This quite clearly shows several mutual support networks between Labour candidates (red edges), Conservative candidates (blue edges), independents (black edges) and a large grouping of UKIP candidates (purple edges).</p>
<p>So there we have it a quick tour of how to use Gephi to look at the co-support structure of group of local election candidates. Were the highlighted candidates to be successful in their election, it could signify possible factions or groupings within the council, particular amongst the independents? Along the way we saw how to make use of filters, and spotted something we need to check (whether the same person supported two candidates (if that isn&#8217;t allowed?) or whether they are two different people sharing the same name.</p>
<p>If this all seems like too much effort, remembers that there&#8217;s always the <a href="http://blog.ouseful.info/2013/05/08/to-what-extent-do-candidates-support-each-other-redux-a-one-liner-thirty-second-route-to-the-info/">One-Liner, Thirty Second Route to the Info</a>.</p>
<p>PS by the by, a recent FOI request on WhatDoTheyKnow suggests another possible line of enquiry around possible candidates &#8211; if they have been elected to the council before, <a href="https://www.whatdotheyknow.com/request/charles_chapman_former_councillo">how good was their attendance record</a>? (I don&#8217;t think OpenlyLocal scrapes this information? Presumably it is available somewhere on the council website?)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10599/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10599&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=ef_n0ke3NZQ:1W_WEBU6WSc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=ef_n0ke3NZQ:1W_WEBU6WSc:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=ef_n0ke3NZQ:1W_WEBU6WSc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=ef_n0ke3NZQ:1W_WEBU6WSc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=ef_n0ke3NZQ:1W_WEBU6WSc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=ef_n0ke3NZQ:1W_WEBU6WSc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=ef_n0ke3NZQ:1W_WEBU6WSc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=ef_n0ke3NZQ:1W_WEBU6WSc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=ef_n0ke3NZQ:1W_WEBU6WSc:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/ef_n0ke3NZQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/08/more-storyhunting-around-local-elections-data-using-gephi-to-what-extent-do-candidates-support-each-other/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/tidier-intra-candidate-support-map.png" medium="image">
			<media:title type="html">Tidier intra-candidate support map</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/scraperwiki-council-elections-assentors.png" medium="image">
			<media:title type="html">scraperwiki council elections - assentors</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/iw-poll-notice-assentors.png" medium="image">
			<media:title type="html">IW poll notice assentors</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/scraperwiki-csv-download.png" medium="image">
			<media:title type="html">Scraperwiki CSV download</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/gephi-org.png" medium="image">
			<media:title type="html">Gephi.org</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/csv-rename.png" medium="image">
			<media:title type="html">csv rename</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/geohi-data-lab-new-project.png" medium="image">
			<media:title type="html">geohi data lab new project</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/gephi-import-spreadsheet.png" medium="image">
			<media:title type="html">gephi import spreadsheet</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/import-data-into-gephi-ata-laboaratory.png" medium="image">
			<media:title type="html">import data into gephi data laboaratory</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/source-and-target-recognised.png" medium="image">
			<media:title type="html">SOurce and Target recognised</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/data-loaded-in.png" medium="image">
			<media:title type="html">Data loaded in</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/mess1.png" medium="image">
			<media:title type="html">mess...</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/force-layout-tweaks.png" medium="image">
			<media:title type="html">force layout tweaks</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/close-up-simple-patterns1.png" medium="image">
			<media:title type="html">Close up simple patterns</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/candidate-support1.png" medium="image">
			<media:title type="html">candidate support</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/lots-going-on.png" medium="image">
			<media:title type="html">lots going on</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/a-few-more-tweaks.png" medium="image">
			<media:title type="html">A few more tweaks</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/improve-the-layout.png" medium="image">
			<media:title type="html">improve the layout</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/colour-the-groups.png" medium="image">
			<media:title type="html">colour the groups</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/gephi-reset-colours.png" medium="image">
			<media:title type="html">Gephi reset colours</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/preview-layout.png" medium="image">
			<media:title type="html">Preview layout</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/this-is-odd.png" medium="image">
			<media:title type="html">this is odd</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/filter-on-nodes-out-degree-2.png" medium="image">
			<media:title type="html">Filter on nodes out degree 2</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/nested-filters.png" medium="image">
			<media:title type="html">nested filters</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/nesting-filters-in-gephi.png" medium="image">
			<media:title type="html">Nesting filters in gephi</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/tidier-intra-candidate-support-map.png" medium="image">
			<media:title type="html">Tidier intra-candidate support map</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/08/more-storyhunting-around-local-elections-data-using-gephi-to-what-extent-do-candidates-support-each-other/</feedburner:origLink></item>
		<item>
		<title>Ephemeral Citations – When Presentations You Have Cited Vanish from the Public Web</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/p_6KuJOnySI/</link>
		<comments>http://blog.ouseful.info/2013/05/07/ephemeral-citations-when-presentations-you-have-cited-vanish-from-the-public-web/#comments</comments>
		<pubDate>Tue, 07 May 2013 17:35:44 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Infoskills]]></category>
		<category><![CDATA[digischol]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10595</guid>
		<description>A couple of months ago, I came across an interesting slide deck reviewing some of the initiatives that Narrative Science have been involved with, including the generation of natural language interpretations of school education grade reports (I think: some natural language take on an individual&amp;#8217;s academic scores, at least?). With MOOC fever in part focussing [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10595&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>A couple of months ago, I came across an interesting slide deck reviewing some of the initiatives that Narrative Science have been involved with, including the generation of natural language interpretations of school education grade reports (I think: some natural language take on an individual&#8217;s academic scores, at least?). With MOOC fever in part focussing on the development of automated marking and feedback reports, this represents one example of how we might take numerical reports and dashboard displays and turn them into human readable text with some sort of narrative. (Narrative Science do a related thing for reports on schools themselves &#8211; <a href="http://www.propublica.org/nerds/item/how-to-edit-52000-stories-at-once">How To Edit 52,000 Stories at Once</a>.)</p>
<p>Whenever I come across a slide deck that I think may be in danger of being taken down (for example, because it&#8217;s buried down a downloads path on a corporate workshop promoter&#8217;s website and has CONFIDENTIAL written all over it) I try to grab a copy of it, but this presentation looked &#8220;safe&#8221; because it had been on Slideshare for some time.</p>
<p>Since I discovered the presentation, I&#8217;ve been recommending it to variou folk, particularly slides 20-22? that refer to the educational example. Trying to find the slidedeck today, a websearch failed to turn it up so I had to go sniffing around to see if I had mentioned a <a href="http://www.slideshare.net/justinlink/introduction-to-narrative-science-13728805">link to the original presentation</a> anywhere. Here&#8217;s what I found:</p>
<p><a href="http://www.slideshare.net/justinlink/introduction-to-narrative-science-13728805"><img src="http://ouseful.files.wordpress.com/2013/05/no-narrative-science-slideshow.png?w=700&#038;h=300" alt="no narrative science slideshow" width="700" height="300" class="alignnone size-full wp-image-10596" /></a></p>
<p>The Wayback machine had grabbed bits and pieces of text, but not the actual slides&#8230;</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/wayback-narrative-science.png"><img src="http://ouseful.files.wordpress.com/2013/05/wayback-narrative-science.png?w=700&#038;h=482" alt="wayback narrative science" width="700" height="482" class="alignnone size-full wp-image-10597" /></a></p>
<p>Not only did I not download the presentation, I don&#8217;t seem to have grabbed any screenshots of the slides I was particularly interested in&#8230; bah:-(</p>
<p>For what it&#8217;s worth, here&#8217;s the commentary:</p>
<blockquote><p>Introduction to Narrative Science — Presentation Transcript</p>
<p>We Transform Data IntoStories and Insight…In Seconds<br />
Automatically,Without Human Intervention and at a Significant Scale<br />
To Help Companies: Create New Products Improve Decision-MakingOptimize Customer Interactions<br />
Customer Types Media and Data Business Publishing Companies Reporting<br />
How Does It Work? The Data The Facts The Angles The Structure Stats Tests Calls The Narrative Language Completed Text Our technology platform, Quill™, is a powerful integration of artificial intelligence and data analytics that automatically transforms data into stories.<br />
The following slides are examples of our work based upon a simple premise: structured data in, narrative out. These examples span several domains, including Sports Journalism, Financial Reporting, Real Estate, Business Intelligence, Education, and Marketing Services.<br />
Sports Journalism: Big Ten Network – Data InTransforming Data into Stories<br />
Sports Journalism: Big Ten Network – NarrativeTransforming Data into Stories<br />
Financial Journalism: Forbes – Data InTransforming Data into Stories<br />
Financial Journalism: Forbes – NarrativeTransforming Data into Stories<br />
Short Sale Reporting: Data Explorers &#8211; JSON Input<br />
Short Sale Reporting: Data Explorers &#8211; Overview North America Consumer Services Short Interest Update There has been a sharp decline in short interest in Marriott International (MAR) in the face of an 11% increase in the companys stock price. Short holdings have declined nearly 14% over the past month to 4.9% of shares outstanding. In the last month, holdings of institutional investors who lend have remained relatively unchanged at just below 17% of the companys shares. Investors have built up their short positions in Carnival (CCL) by 54.3% over the past month to 3.1% of shares outstanding. The share price has gained 8.3% over the past week to $31.93. Holdings of institutional investors who lend are also up slightly over the past month to just above 23% of the common shares in issue by the company. Institutional investors who make their shares available to borrow have reduced their holdings in Weight Watchers International (WTW) by more than 26% to just above 10% of total shares outstanding over the past month. Short sellers have also cut back their positions slightly to just under 6% of the market cap. The price of shares in the company has been on the rise for seven consecutive days and is now at $81.50.<br />
Sector Reporting: Data Explorers &#8211; JSON Input<br />
Sector Reporting: Data Explorers &#8211; OverviewThursday, October 6, 2011 12:00 PM: HEALTHCARE MIDDAY COMMENTARY:The Healthcare (XLV) sector underperformed the market in early trading on Thursday. Healthcarestocks trailed the market by 0.4%. So far, the Dow rose 0.2%, the NASDAQ saw growth of 0.8%, andthe S&amp;P500 was up 0.4%.Here are a few Healthcare stocks that bucked the sectors downward trend.MRK (Merck &amp; Co Inc.) erased early losses and rose 0.6% to $31.26. The company recentlyannounced its chairman is stepping down. MRK stock traded in the range of $31.21 &#8211; $31.56. MRKsvolume was 86.1% lower than usual with 2.5 million shares trading hands. Todays gains still leavethe stock about 11.1% lower than its price three months ago.LUX (Luxottica Group) struggled in early trading but showed resilience later in the day. Shares rose3.8% to $26.92. LUX traded in the range of $26.48 &#8211; $26.99. Luxottica Group’s early share volumewas 34,155. Todays gains still leave the stock 21.8% below its 52-week high of $34.43. The stockremains about 16.3% lower than its price three months ago.Shares of UHS (Universal Health Services Inc.) are trading at $32.89, up 81 cents (2.5%) from theprevious close of $32.08. UHS traded in the range of $32.06 &#8211; $33.01…<br />
Real Estate: Hanley Wood – Data InTransforming Data into Stories<br />
Real Estate: Hanley Wood – NarrativeTransforming Data into Stories<br />
BI: Leading Fast Food Chain – Data InTransforming Data into Stories<br />
BI: Leading Fast Food Chain – Store Level Report January Promotion Falling Behind Region The launch of the bagels and cream cheese promotion began this month. While your initial sales at the beginning of the promotion were on track with both your ad co-op and the region, your sales this week dropped from last week’s 142 units down to 128 units. Your morning guest count remained even across this period. Taking better advantage of this promotion should help to increase guest count and overall revenue by bringing in new customers. The new item with the greatest growth opportunity this week was the Coffee Cake Muffin. Increasing your sales by just one unit per thousand transactions to match Sales in the region would add another $156 to your monthly profit. That amounts to about $1872 over the course of one year.Transforming Data into Stories<br />
Education: Standardized Testing – Data InTransforming Data into Stories<br />
Education: Standardized Testing – Study RecommendationsTransforming Data into Stories<br />
Marketing Services &amp; Digital Media: Data InTransforming Data into Stories<br />
Marketing Services &amp; Digital Media: NarrativeTransforming Data into Stories</p></blockquote>
<p>Bah&#8230;:-(</p>
<p>PS Slideshare appears to have a new(?) feature &#8211; Saved Files &#8211; that keeps a copy of files you have downloaded. Or does it? If I save a file and someone deletes it, will the empty shell only remain in my &#8220;Saved Files&#8221; list?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10595/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10595/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10595&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=p_6KuJOnySI:TXd_Ebc7pz8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=p_6KuJOnySI:TXd_Ebc7pz8:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=p_6KuJOnySI:TXd_Ebc7pz8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=p_6KuJOnySI:TXd_Ebc7pz8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=p_6KuJOnySI:TXd_Ebc7pz8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=p_6KuJOnySI:TXd_Ebc7pz8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=p_6KuJOnySI:TXd_Ebc7pz8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=p_6KuJOnySI:TXd_Ebc7pz8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=p_6KuJOnySI:TXd_Ebc7pz8:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/p_6KuJOnySI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/07/ephemeral-citations-when-presentations-you-have-cited-vanish-from-the-public-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/no-narrative-science-slideshow.png" medium="image">
			<media:title type="html">no narrative science slideshow</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/wayback-narrative-science.png" medium="image">
			<media:title type="html">wayback narrative science</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/07/ephemeral-citations-when-presentations-you-have-cited-vanish-from-the-public-web/</feedburner:origLink></item>
		<item>
		<title>Questioning Election Data to See if It Has a Story to Tell</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/0fdIopdDiTI/</link>
		<comments>http://blog.ouseful.info/2013/05/05/questioning-election-data-to-see-if-it-has-a-story-to-tell/#comments</comments>
		<pubDate>Sun, 05 May 2013 23:38:40 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[digital storytelling]]></category>
		<category><![CDATA[OpenRefine]]></category>
		<category><![CDATA[ddj]]></category>
		<category><![CDATA[schoolofdata]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10547</guid>
		<description>I know, I know, the local elections are old news now, but elections come round again and again, which means building up a set of case examples of what we might be able to do &amp;#8211; data wise &amp;#8211; around elections in the future could be handy&amp;#8230; So here&amp;#8217;s one example of a data-related question [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10547&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>I know, I know, the local elections are old news now, but elections come round again and again, which means building up a set of case examples of what we might be able to do &#8211; data wise &#8211; around elections in the future could be handy&#8230;</p>
<p>So here&#8217;s one example of a data-related question we might ask (where in this case by data I mean &#8220;information available in: a) electronic form, that b) can be represented in a structured way): <em>are the candidates standing in different seats local to that ward/electoral division?</em>. By &#8220;local&#8221;, I mean &#8211; can they vote in that ward by virtue of having a home address that lays within that ward?</p>
<p>Here&#8217;s what the original data for my own local council (the Isle of Wight council, a unitary authority) looked like &#8211; a multi-page PDF document collating the <a href="http://www.iwight.com/azservices/documents/1174-Notice%20of%20Poll%20-%20IOWC%20May%202013.pdf">Notice of polls</a> for each electoral division (<a href="https://dl.dropboxusercontent.com/u/1156404/1174-Notice%20of%20Poll%20-%20IOWC%20May%202013.pdf">archive copy</a>): </p>
<p><a href="http://www.iwight.com/azservices/documents/1174-Notice%20of%20Poll%20-%20IOWC%20May%202013.pdf"><img src="http://ouseful.files.wordpress.com/2013/05/iw-council-notice-of-poll.png?w=700" alt="IW council - notice of poll"   class="alignnone size-full wp-image-10548" /></a></p>
<p>Although it&#8217;s a PDF, the document is reasonably nicely structured for scraping (I&#8217;ll do a post on this over the next week or two) &#8211; you can find a Scraperwiki scraper <a href="https://scraperwiki.com/scrapers/iw_poll_notices_scrape/">here</a>. I pull out three sorts of data &#8211; information about the polling stations (the table at the bottom of the page), information about the signatories (of which, more in a later post&#8230;;-), and information about the candidates, including the electoral division in which they were standing (the &#8220;ward&#8221; column) and a home address for them, as shown here:</p>
<p><a href="https://scraperwiki.com/scrapers/iw_poll_notices_scrape/"><img src="http://ouseful.files.wordpress.com/2013/05/scraperwiki-candidates.png?w=700&#038;h=371" alt="scraperwiki candidates" width="700" height="371" class="alignnone size-full wp-image-10549" /></a></p>
<p>So what might we be able to do with this information? Does the <em>home address</em> take us anywhere interesting? Maybe. If we can easily look up the electoral division the home addresses fall in, we have a handful of news story search opportunities: 1) to what extent are candidates &#8211; and election winners &#8211; &#8220;local&#8221;? 2) do any of the parties appear to favour standing in/out of ward candidates? 3) if candidates are standing out of their home ward, why? If we complement the data with information about the number of votes cast for each candidate, might we be able to find any patterns suggestive of a beneficial or detrimental effect living within, or outside of, the electoral division a candidate is standing in, and so on.</p>
<p>In this post, I&#8217;ll describe a way of having a conversation with the data using OpenRefine and Google Fusion Tables as a way of starting to explore some the stories we may be able to tell with, and around, the data. (Bruce Mcphereson/<em>Excel Liberation</em> blog has also posted an Excel version of the methods described in the post: <a href="http://excelramblings.blogspot.co.uk/2013/05/mashing-up-electoral-data-follow-on.html">Mashing up electoral data</a>. Thanks, Bruce:-)</p>
<p>Let&#8217;s get the data into OpenRefine so we can start to work it. Scraperwiki provides a CSV output format for each scraper table, so we can <a href="https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=csv&amp;name=iw_poll_notices_scrape&amp;query=select+*+from+`candidates`&amp;apikey=">get a URL</a> for it that we can then use to pull the data into OpenRefine:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/scraperwiki-csv-export.png"><img src="http://ouseful.files.wordpress.com/2013/05/scraperwiki-csv-export.png?w=700" alt="scraperwiki CSV export"   class="alignnone size-full wp-image-10581" /></a></p>
<p>In OpenRefine, we can Create a New Project and then import the data directly:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/openrefine-import-from-url.png"><img src="http://ouseful.files.wordpress.com/2013/05/openrefine-import-from-url.png?w=700&#038;h=150" alt="openrefine import from URL" width="700" height="150" class="alignnone size-full wp-image-10580" /></a></p>
<p>The data is in comma separated CSV format, so let&#8217;s specify that:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/import-as-csv-comma-separated.png"><img src="http://ouseful.files.wordpress.com/2013/05/import-as-csv-comma-separated.png?w=700" alt="import as csv comma separated"   class="alignnone size-full wp-image-10579" /></a></p>
<p>We can then name and create the project and we&#8217;re ready to start&#8230;</p>
<p>&#8230;but start what? If we want to find out if a candidate lives in ward or out of ward, we either need to know whether their address is in ward or out of ward, or we need to find out which ward their address is in and then see if it is the same as the one they are standing in.</p>
<p>Now it just so happens (:-) that MySociety run a service called <a href="http://mapit.mysociety.org/">MapIt</a> that lets you submit a postcode and it tells you a whole host of things about what administrative areas that postcode is in, including (in this case) the unitary authority electoral division.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/mapit-postcode-lookup.png"><img src="http://ouseful.files.wordpress.com/2013/05/mapit-postcode-lookup.png?w=700&#038;h=487" alt="mapit postcode lookup" width="700" height="487" class="alignnone size-full wp-image-10577" /></a></p>
<p>And what&#8217;s more, MapIt also makes the data available in a format that&#8217;s data ready for OpenRefine to be able to read at a web address (aka a URL) that we can construct from a postcode:</p>
<p><a href="http://mapit.mysociety.org/postcode/po36%200JT.html"><img src="http://ouseful.files.wordpress.com/2013/05/mapit-json.png?w=700" alt="mapit json"   class="alignnone size-full wp-image-10578" /></a></p>
<p>Here&#8217;s an example of just such a web address: <tt><a href="http://mapit.mysociety.org/postcode/PO36%200JT" rel="nofollow">http://mapit.mysociety.org/postcode/PO36%200JT</a></tt></p>
<p>Can you see the postcode in there? <tt><a href="http://mapit.mysociety.org/postcode/" rel="nofollow">http://mapit.mysociety.org/postcode/</a><strong>PO36%200JT</strong></tt></p>
<p>The %20 is a character encoding for a space. In this case, we can also use a +.</p>
<p>So &#8211; to get information about the electoral division an address lays in, we need to get the postcode, construct a URL to pull down corresponding data from MapIt, and then figure out some way to get the electoral division name out of the data. But one step at a time, eh?!;-)</p>
<p><em>Hmmm&#8230;I wonder if postcode areas <em>necessarily</em> fall within electoral divisions? I can imagine (though it may be incorrect to do so!) a situation where a division boundary falls within a postcode area, so we need to be suspicious about the result, or at least bear in mind that an address falling near a division boundary may be wrongly classified. (I guess if we plot postcodes on a map, we could look to see how close to the boundary line they are, because <a href="http://schoolofdata.org/2013/05/02/proving-the-data-a-quick-guide-to-mapping-local-elections/">we already know how to plot boundary lines</a>.</em></p>
<p>To grab the postcode, a quick skim of the addresses suggests that they are written in a standard way &#8211; the postcode always seems to appear at the end of the string preceded by a comma. We can use this information to extract the postcode, by splitting the address at each comma into an ordered list of chunks, then picking the last item in the list. Because the postcode might be preceded by a space character, it&#8217;s often convenient for us to <em>strip()</em> any white space surrounding it.</p>
<p>What we want to do then is to create a new, derived column based on the address:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/add-derived-column.png"><img src="http://ouseful.files.wordpress.com/2013/05/add-derived-column.png?w=700" alt="Add derived column"   class="alignnone size-full wp-image-10576" /></a></p>
<p>And we do this by creating a list of comma separated chunks from the address, picking the last one (by counting backwards from the end of the list), and then stripping off any whitespace/space characters that surround it:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/grab-a-postcode.png"><img src="http://ouseful.files.wordpress.com/2013/05/grab-a-postcode.png?w=700" alt="grab a postcode"   class="alignnone size-full wp-image-10575" /></a></p>
<p>Here&#8217;s the result&#8230;</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/postcodes.png"><img src="http://ouseful.files.wordpress.com/2013/05/postcodes.png?w=700" alt="postcodes..."   class="alignnone size-full wp-image-10574" /></a></p>
<p>Having got the postcode, we can now generate a URL from it and then pull down the data from each URL:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/col-from-url.png"><img src="http://ouseful.files.wordpress.com/2013/05/col-from-url.png?w=700" alt="col from URL"   class="alignnone size-full wp-image-10573" /></a></p>
<p>When constructing the web address, we need to remember to encode the postcode by escaping it so as not to break the URL:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/get-data-from-url.png"><img src="http://ouseful.files.wordpress.com/2013/05/get-data-from-url.png?w=700" alt="get data from URL"   class="alignnone size-full wp-image-10572" /></a></p>
<p>The throttle value slows down the rate at which OpenRefine loads in data from the URLs. If we set it to 500 milliseconds, it will load one page every half a second.</p>
<p>When it&#8217;s loaded in all the data, we get a new column, filled with data from the MapIt service&#8230;</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/lots-of-data.png"><img src="http://ouseful.files.wordpress.com/2013/05/lots-of-data.png?w=700&#038;h=307" alt="lots of data" width="700" height="307" class="alignnone size-full wp-image-10571" /></a></p>
<p>We now need to parse this data (which is in a JSON format) to pull out the electoral division. There&#8217;s a bit of jiggery pokery required to do this, and I couldn&#8217;t work it out myself at first, but <a href="http://stackoverflow.com/questions/10782737/google-refine-iterate-over-a-json-dictionary">Stack Overflow came to the rescue</a>:</p>
<p><a href="http://stackoverflow.com/questions/10782737/google-refine-iterate-over-a-json-dictionary"><img src="http://ouseful.files.wordpress.com/2013/05/thats-handy.png?w=700&#038;h=710" alt="that&#039;s handy..." width="700" height="710" class="alignnone size-full wp-image-10570" /></a></p>
<p>We need to tweak that expression slightly by first grabbing the <em>areas</em> data from the full set of MapIt data. Here&#8217;s the expression I used:</p>
<p><tt>filter(('[' + (value.parseJson()['areas'].replace( /"[0-9]+":/,""))[1,-1] + ']' ).parseJson(), v, v['type']=='UTE' )[0]['name']</tt></p>
<p>to create a new column containing the electoral division:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/parse-out-the-electroal-division.png"><img src="http://ouseful.files.wordpress.com/2013/05/parse-out-the-electroal-division.png?w=700" alt="parse out the electroal division"   class="alignnone size-full wp-image-10569" /></a></p>
<p>Now we can create another column, this time based on the new Electoral Division column, that compares the value against the corresponding original &#8220;ward&#8221; column value (i.e. the electoral division the candidate was standing in) and prints a message saying whether they were standing <em>in</em> ward or <em>out</em>:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/inward-or-out.png"><img src="http://ouseful.files.wordpress.com/2013/05/inward-or-out.png?w=700" alt="inward or out"   class="alignnone size-full wp-image-10568" /></a></p>
<p>If we collapse down the spare columns, we get a clearer picture:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/collapse.png"><img src="http://ouseful.files.wordpress.com/2013/05/collapse.png?w=700" alt="collapse..."   class="alignnone size-full wp-image-10567" /></a></p>
<p>Like this:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/summary-data.png"><img src="http://ouseful.files.wordpress.com/2013/05/summary-data.png?w=700&#038;h=189" alt="summary data" width="700" height="189" class="alignnone size-full wp-image-10566" /></a></p>
<p>If we generate a text facet on the In/Out column, and increase the number of rows displayed, we can filter the results to show just the candidates who stood in their local electoral division (or conversely, those who stood outside it):</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/facet-on-inout.png"><img src="http://ouseful.files.wordpress.com/2013/05/facet-on-inout.png?w=700" alt="facet on inout"   class="alignnone size-full wp-image-10565" /></a></p>
<p>We can also start to get investigative, and ask some more questions of the data. For example, we could apply a text facet on the party/desc column to let us filter the results even more&#8230;</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/inout-facet-filter.png"><img src="http://ouseful.files.wordpress.com/2013/05/inout-facet-filter.png?w=700&#038;h=128" alt="inout facet filter" width="700" height="128" class="alignnone size-full wp-image-10564" /></a></p>
<p>Hmmm&#8230; were most of the Labour Party candidates standing outside their home division (and hence unable to vote for themselves?!)</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/hmm-labour-out.png"><img src="http://ouseful.files.wordpress.com/2013/05/hmm-labour-out.png?w=700&#038;h=230" alt="Hmm.. labour out" width="700" height="230" class="alignnone size-full wp-image-10563" /></a></p>
<p>There aren&#8217;t too many parties represented across the Island elections (a text facet on the desc/party description column should reveal them all), so it wouldn&#8217;t be too hard to treat the data as a source, get paper and pen in hand, and write down the in/out counts for each party describing the extent to which they fielded candidates who lived in the electoral divisions they were standing in (and as such, could vote for themselves!) versus those who lived &#8220;outside&#8221;. This data could reasonably be displayed using a staggered bar chart (the data collection and plotting are left as an exercise for the reader  <em>[See Bruce Mcphereson's <a href="http://excelramblings.blogspot.co.uk/2013/05/mashing-up-electoral-data-follow-on.html">Mashing up electoral data</a> post for a stacked bar chart view.]</em>;-) Another possible questioning line is how do the different electoral divisions fare in terms of in-vs-out resident candidates. If we pull in affluence/poverty data, might it tell us anything about the likelihood of candidates living in area, or even tell us something about the likely socio-economic standing of the candidates?</p>
<p>One more thing we could try to do is to geocode the postcode of the address of the each candidate rather more exactly. A blog post by Ordnance Survey blogger John Goodwin (@gothwin) shows how we might do this (<em>note: copying the code from John&#8217;s post won&#8217;t necessarily work; WordPress has a tendency to replace single quotes with all manner of exotic punctuation marks that f**k things up when you copy and paste them into froms for use in other contexts</em>). When we &#8220;Add column by fetching URLs&#8221;, we should use something along the lines of the following:</p>
<p><tt>'http://beta.data.ordnancesurvey.co.uk/datasets/code-point-open/apis/search?output=json&amp;query=' + escape(value,'url')</tt></p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/os-postcode-lookup.png"><img src="http://ouseful.files.wordpress.com/2013/05/os-postcode-lookup.png?w=700" alt="os postcode lookup"   class="alignnone size-full wp-image-10562" /></a></p>
<p>The data, as imported from the Ordnance Survey, looks something like this:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/osdata.png"><img src="http://ouseful.files.wordpress.com/2013/05/osdata.png?w=700&#038;h=233" alt="o:sdata" width="700" height="233" class="alignnone size-full wp-image-10587" /></a></p>
<p>As is the way of national services, the Ordnance Survey returns a data format that is all well and good but isn&#8217;t the one that mortals use. Many of my geo-recipes rely on latitude and longitude co-ordinates, but the call to the Ordnance Survey API returns Eastings and Northings.</p>
<p>Fortunately, Paul Bradshaw had come across this problem before (<a href="http://onlinejournalismblog.com/2011/08/12/how-to-convert-eastingnorthing-into-latlong-for-an-interactive-map/">How to: Convert Easting/Northing into Lat/Long for an Interactive Map</a>) and bludgeoned(?!;-) Stuart harrison/@pezholio, ex- of Lichfield Council, now of the Open Data Institute, to produce a pop-up service that returns lat/long co-ordinates in exchange for a Northing/Easting pair.</p>
<p>The service relies on URLs of the form <tt><a href="http://www.uk-postcodes.com/eastingnorthing.php?easting=" rel="nofollow">http://www.uk-postcodes.com/eastingnorthing.php?easting=</a><strong>EASTING</strong>&amp;northing=<strong>NORTHING</strong></tt>, which we can construct from data returned from the Ordnance Survey API:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/easting-northing-lat-long.png"><img src="http://ouseful.files.wordpress.com/2013/05/easting-northing-lat-long.png?w=700" alt="easting northing lat -long"   class="alignnone size-full wp-image-10561" /></a></p>
<p>Here&#8217;s what the returned lat/long data looks like:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/lat-long-json.png"><img src="http://ouseful.files.wordpress.com/2013/05/lat-long-json.png?w=700" alt="lat-long json"   class="alignnone size-full wp-image-10560" /></a></p>
<p>We can then create a new column derived from this JSON data by parsing it as follows<br />
<a href="http://ouseful.files.wordpress.com/2013/05/parse-latlong-to-lat.png"><img src="http://ouseful.files.wordpress.com/2013/05/parse-latlong-to-lat.png?w=700" alt="parse latlong to lat"   class="alignnone size-full wp-image-10559" /></a></p>
<p>A similar trick can be used to generate a column containing just the longitude data.</p>
<p>We can then export a view over the data to a CSV file, or <a href="https://www.google.com/fusiontables/DataSource?docid=1-Ngzhdy3WoRO9_CHFzh48rqeV36aMnzAB-PPEqs">direct to Google Fusion tables</a>.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/postcode-lat-long-export.png"><img src="http://ouseful.files.wordpress.com/2013/05/postcode-lat-long-export.png?w=700" alt="postcode lat long export"   class="alignnone size-full wp-image-10558" /></a></p>
<p>With the data in Google Fusion Tables, we can let Fusion Tables know that the Postcode lat and Postcode long columns define a location:2222</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/fusion-table-edit-column.png"><img src="http://ouseful.files.wordpress.com/2013/05/fusion-table-edit-column.png?w=700" alt="Fusion table edit column"   class="alignnone size-full wp-image-10557" /></a></p>
<p>Specifically, we pick either the lat or the long column and use it to cast a two column latitude and longitude location type:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/fusion-table-config-cols-to-location-type.png"><img src="http://ouseful.files.wordpress.com/2013/05/fusion-table-config-cols-to-location-type.png?w=700" alt="fusion table config cols to location type"   class="alignnone size-full wp-image-10556" /></a></p>
<p>We can inspect the location data using a more convenient &#8220;natural&#8221; view over it&#8230;</p>
<p><a href="https://www.google.com/fusiontables/DataSource?docid=1-Ngzhdy3WoRO9_CHFzh48rqeV36aMnzAB-PPEqs"><img src="http://ouseful.files.wordpress.com/2013/05/fusion-table-add-map.png?w=700" alt="fusion table add map"   class="alignnone size-full wp-image-10555" /></a></p>
<p>By applying a filter, we can look to see where the candidates for a particular ward have declared their home address to be:</p>
<p><a href="https://www.google.com/fusiontables/DataSource?docid=1-Ngzhdy3WoRO9_CHFzh48rqeV36aMnzAB-PPEqs"><img src="http://ouseful.files.wordpress.com/2013/05/havenstreet-candidates.png?w=700&#038;h=422" alt="havenstreet candidates" width="700" height="422" class="alignnone size-full wp-image-10553" /></a></p>
<p>(Note &#8211; it would be more useful to plot these markers over a boundary line defined region corresponding to the area covered by the corresponding electoral ward. I don&#8217;t think Fusion Table lets you do this directly (or if it does, I don&#8217;t know how to do it..!). This workaround &#8211; <a href="http://fusion-tables-api-samples.googlecode.com/svn/trunk/FusionTablesLayerWizard/src/index.html">FusionTablesLayer Wizard</a> &#8211; on merging outputs from Fusion Tables as separate layers on a Google Map is the closest I&#8217;ve found following a not very thorough search;-)</p>
<p>We can go back to the tabular view in Fusion Tables to run a filter to see who the candidates were in a particular electoral division, or we can go back to OpenRefine and run a filter (or a facet) on the ward column to see who the candidates were:</p>
<p><a href="https://www.google.com/fusiontables/DataSource?docid=1-Ngzhdy3WoRO9_CHFzh48rqeV36aMnzAB-PPEqs"><img src="http://ouseful.files.wordpress.com/2013/05/refine-filter-by-division.png?w=700&#038;h=349" alt="refine filter by division" width="700" height="349" class="alignnone size-full wp-image-10552" /></a></p>
<p>Filtering on some of the other wards using local knowledge (i.e. using the filter to check/corroborate things I knew), I spotted a couple of missing markers. Going back to the OpenRefine view of the data, I ran a facetted view on the postcode to see if there were any &#8220;none-postcodes&#8221; there that would in turn break the Ordnance Survey postcode geocoding/lookup:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/postcode-missing.png"><img src="http://ouseful.files.wordpress.com/2013/05/postcode-missing.png?w=700&#038;h=320" alt="postcode missing..." width="700" height="320" class="alignnone size-full wp-image-10554" /></a></p>
<p>Ah &#8211; oops&#8230; It seems we have a &#8220;data quality&#8221; issue, although albeit a minor one&#8230;</p>
<p><em>So, what do we learn from all this? One take away for me is that data is a source we can ask questions of. If we have a story or angle in mind, we can tune our questions to tease out corroborating facts (possbily! <tt>caveat emptor</tt> applies!) that might confirm, helpdevelop, or even cause us to rethink, the story we are working towards telling based on the support the data gives us.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10547/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10547/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10547&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=0fdIopdDiTI:cYb4p9L7D8s:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0fdIopdDiTI:cYb4p9L7D8s:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0fdIopdDiTI:cYb4p9L7D8s:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=0fdIopdDiTI:cYb4p9L7D8s:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0fdIopdDiTI:cYb4p9L7D8s:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=0fdIopdDiTI:cYb4p9L7D8s:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0fdIopdDiTI:cYb4p9L7D8s:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=0fdIopdDiTI:cYb4p9L7D8s:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=0fdIopdDiTI:cYb4p9L7D8s:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/0fdIopdDiTI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/05/questioning-election-data-to-see-if-it-has-a-story-to-tell/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/iw-council-notice-of-poll.png" medium="image">
			<media:title type="html">IW council - notice of poll</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/scraperwiki-candidates.png" medium="image">
			<media:title type="html">scraperwiki candidates</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/scraperwiki-csv-export.png" medium="image">
			<media:title type="html">scraperwiki CSV export</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/openrefine-import-from-url.png" medium="image">
			<media:title type="html">openrefine import from URL</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/import-as-csv-comma-separated.png" medium="image">
			<media:title type="html">import as csv comma separated</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/mapit-postcode-lookup.png" medium="image">
			<media:title type="html">mapit postcode lookup</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/mapit-json.png" medium="image">
			<media:title type="html">mapit json</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/add-derived-column.png" medium="image">
			<media:title type="html">Add derived column</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/grab-a-postcode.png" medium="image">
			<media:title type="html">grab a postcode</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/postcodes.png" medium="image">
			<media:title type="html">postcodes...</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/col-from-url.png" medium="image">
			<media:title type="html">col from URL</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/get-data-from-url.png" medium="image">
			<media:title type="html">get data from URL</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/lots-of-data.png" medium="image">
			<media:title type="html">lots of data</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/thats-handy.png" medium="image">
			<media:title type="html">that's handy...</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/parse-out-the-electroal-division.png" medium="image">
			<media:title type="html">parse out the electroal division</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/inward-or-out.png" medium="image">
			<media:title type="html">inward or out</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/collapse.png" medium="image">
			<media:title type="html">collapse...</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/summary-data.png" medium="image">
			<media:title type="html">summary data</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/facet-on-inout.png" medium="image">
			<media:title type="html">facet on inout</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/inout-facet-filter.png" medium="image">
			<media:title type="html">inout facet filter</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/hmm-labour-out.png" medium="image">
			<media:title type="html">Hmm.. labour out</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/os-postcode-lookup.png" medium="image">
			<media:title type="html">os postcode lookup</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/osdata.png" medium="image">
			<media:title type="html">o:sdata</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/easting-northing-lat-long.png" medium="image">
			<media:title type="html">easting northing lat -long</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/lat-long-json.png" medium="image">
			<media:title type="html">lat-long json</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/parse-latlong-to-lat.png" medium="image">
			<media:title type="html">parse latlong to lat</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/postcode-lat-long-export.png" medium="image">
			<media:title type="html">postcode lat long export</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/fusion-table-edit-column.png" medium="image">
			<media:title type="html">Fusion table edit column</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/fusion-table-config-cols-to-location-type.png" medium="image">
			<media:title type="html">fusion table config cols to location type</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/fusion-table-add-map.png" medium="image">
			<media:title type="html">fusion table add map</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/havenstreet-candidates.png" medium="image">
			<media:title type="html">havenstreet candidates</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/refine-filter-by-division.png" medium="image">
			<media:title type="html">refine filter by division</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/postcode-missing.png" medium="image">
			<media:title type="html">postcode missing...</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/05/questioning-election-data-to-see-if-it-has-a-story-to-tell/</feedburner:origLink></item>
		<item>
		<title>A Wrangling Example With OpenRefine: Making “Oven Ready Data”</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/2Z5KZm7WhbE/</link>
		<comments>http://blog.ouseful.info/2013/05/03/a-wrangling-example-with-openrefine-making-ready-data/#comments</comments>
		<pubDate>Fri, 03 May 2013 23:33:20 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[OpenRefine]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10500</guid>
		<description>As well as being a great tool for cleaning data, OpenRefine can also be used to good effect when you need to wrangle a dataset into another shape. Take this set of local election results published by the Isle of Wight local online news blog, onthewight.com: There&amp;#8217;s lots of information in there (rank of each [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10500&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>As well as being a great tool for cleaning data, OpenRefine can also be used to good effect when you need to wrangle a dataset into another <em>shape</em>. Take this set of <a href="http://onthewight.com/2013/05/03/isle-of-wight-election-results-2013-the-detail/">local election results</a> published by the Isle of Wight local online news blog, onthewight.com:</p>
<p><a href="http://onthewight.com/2013/05/03/isle-of-wight-election-results-2013-the-detail/"><img src="http://ouseful.files.wordpress.com/2013/05/onthewight-results.png?w=700&#038;h=671" alt="onthewight results" width="700" height="671" class="alignnone size-full wp-image-10501" /></a></p>
<p>There&#8217;s lots of information in there (rank of each candidate for each electoral division, votes cast per candidate, size of electorate for the division, and hence percentage turnout, and so on), and it&#8217;s very nearly available in a <em>ready data</em> format &#8211; that is, a data format that is ready for reuse&#8230; Something like this, for example:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/slightly-tidier.png"><img src="http://ouseful.files.wordpress.com/2013/05/slightly-tidier.png?w=700" alt="Slightly tidier"   class="alignnone size-full wp-image-10502" /></a></p>
<p>Or how about something like this, that shows the size of the electorate for each ward:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/turnout.png"><img src="http://ouseful.files.wordpress.com/2013/05/turnout.png?w=700" alt="turnout"   class="alignnone size-full wp-image-10538" /></a></p>
<p>So how can we get from the OnTheWight results into a ready data format?</p>
<p>Let&#8217;s start by copying all the data from OnTheWight (click into the results frame, select all (ctrl-A) and copy (ctrl-v); I&#8217;ve also posted a copy of the data I grabbed <a href="https://dl.dropboxusercontent.com/u/1156404/IW-results.tsv">here</a>*), then paste the data into a new OpenRefine project:</p>
<p><a href="https://docs.google.com/spreadsheet/ccc?key=0AirrQecc6H_vdDZzakNidXMtY05rRlF4U0VRd2VjM0E&amp;usp=sharing"><img src="http://ouseful.files.wordpress.com/2013/05/paste-data-into-openrefine.png?w=700&#038;h=357" alt="Paste data into OpenRefine" width="700" height="357" class="alignnone size-full wp-image-10534" /></a></p>
<p><small><em>* there were a couple of data quality issues (now resolved in the sheet published by OnTheWight) which relate to the archived data file/data used in this walkthrough. Here are the change notes from @onTheWight:</p>
<p><tt>_Corrected vote numbers<br />
Totland - Winning votes wrong - missed zero off end - 420 not 42<br />
Brading, St Helens &amp; Bembridge - Mike Tarrant (UKIP) got 741 not 714</p>
<p>_Votes won by figures - filled in<br />
Lots of the 'Votes won by figures' had the wrong number in them. It's one of the few figures that needed a manual formula update and in the rush of results (you heard how fast they come), it just wasn't possible.</p>
<p>'Postal votes (inc)' line inserted between 'Total votes cast' and 'Papers spoilt'</p>
<p>Deleted an empty row from Ventnor West</tt></em></small></p>
<p>The data format is &#8220;tab separated&#8221;, so we can import it as such. We might as well get rid of the blank lines at the same time.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/import-data-as-tsv-no-blanks.png"><img src="http://ouseful.files.wordpress.com/2013/05/import-data-as-tsv-no-blanks.png?w=700&#038;h=532" alt="import data as TSV no blanks" width="700" height="532" class="alignnone size-full wp-image-10533" /></a></p>
<p>Here&#8217;s what we end up with:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/election-data-raw-import.png"><img src="http://ouseful.files.wordpress.com/2013/05/election-data-raw-import.png?w=700" alt="ELection data raw import"   class="alignnone size-full wp-image-10532" /></a></p>
<p>The data format I want is has a column specifying the ward each candidate stood in. Let&#8217;s start by creating a new column that is a copy of the column that has the Electoral Division names in it:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/copy-a-column.png"><img src="http://ouseful.files.wordpress.com/2013/05/copy-a-column.png?w=700" alt="COpy a column"   class="alignnone size-full wp-image-10531" /></a></p>
<p>Let&#8217;s define the new column as having exactly the same <tt>value</tt> as the original column:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/create-new-col-as-copy-of-old.png"><img src="http://ouseful.files.wordpress.com/2013/05/create-new-col-as-copy-of-old.png?w=700" alt="Create new col as copy of old"   class="alignnone size-full wp-image-10530" /></a></p>
<p>Now we start puzzling based on what we want to achieve bearing in mind what we can do with OpenRefine. (Sometimes there are many ways of solving a problem, sometimes there is only one, sometimes there may not be any obvious route&#8230;)</p>
<p>The Electoral Division column contains the names of the Electoral Divisions on some rows, and numbers (highlighted green) on others. If we identify the rows containing numbers in that column, we can blank them out&#8230; The Numeric facet will let us do that:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/facet-the-numbers.png"><img src="http://ouseful.files.wordpress.com/2013/05/facet-the-numbers.png?w=700" alt="Facet the numbers"   class="alignnone size-full wp-image-10529" /></a></p>
<p>Select just the rows containing a numeric value in the Electoral Division column, and then replace those values with blanks.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/filter-and-blank.png"><img src="http://ouseful.files.wordpress.com/2013/05/filter-and-blank.png?w=700&#038;h=315" alt="filter and blank" width="700" height="315" class="alignnone size-full wp-image-10528" /></a></p>
<p>Then remove the numeric facet filter:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/filter-update.png"><img src="http://ouseful.files.wordpress.com/2013/05/filter-update.png?w=700" alt="filter update"   class="alignnone size-full wp-image-10527" /></a></p>
<p>Here&#8217;s the result, much tidier:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/much-tidier.png"><img src="http://ouseful.files.wordpress.com/2013/05/much-tidier.png?w=700&#038;h=504" alt="Much tidier" width="700" height="504" class="alignnone size-full wp-image-10526" /></a></p>
<p>Before we fill in the blanks with the Electoral Division names, let&#8217;s just note that there is at least one &#8220;messy&#8221; row in there corresponding to Winning Margin. We don&#8217;t really need that row &#8211; we can always calculate it &#8211; so let&#8217;s remove it. One way of doing this is to display just the rows containing the &#8220;Winning margin&#8221; string in column three, and then delete them. We can use the TExt filter to highlight the rows:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/selectt-openrefine-filter.png"><img src="http://ouseful.files.wordpress.com/2013/05/selectt-openrefine-filter.png?w=700" alt="Selectt OpenRefine filter"   class="alignnone size-full wp-image-10525" /></a></p>
<p>Simply state the value you want to filter on and blitz the matching rows&#8230;</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/choose-rows-then-blitz-them.png"><img src="http://ouseful.files.wordpress.com/2013/05/choose-rows-then-blitz-them.png?w=700&#038;h=308" alt="CHoose rows then blitz them" width="700" height="308" class="alignnone size-full wp-image-10524" /></a></p>
<p>&#8230;then remove the filter:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/then-remove-the-filter.png"><img src="http://ouseful.files.wordpress.com/2013/05/then-remove-the-filter.png?w=700" alt="then remove the filter"   class="alignnone size-full wp-image-10523" /></a></p>
<p>We can now fill down a the blanks in the Electoral Division column:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/fill-down-on-electoral-division.png"><img src="http://ouseful.files.wordpress.com/2013/05/fill-down-on-electoral-division.png?w=700" alt="Fill down on Electoral Division"   class="alignnone size-full wp-image-10522" /></a></p>
<p>Fill down starts at the top of the column then works its way down, filling in blank cells in that column with whatever was in the cell immediately above.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/filled-down-now-flag-unwanted-row.png"><img src="http://ouseful.files.wordpress.com/2013/05/filled-down-now-flag-unwanted-row.png?w=700" alt="Filled down - now flag unwanted row"   class="alignnone size-full wp-image-10521" /></a></p>
<p>Looking at the data, I notice the first row is also &#8220;unwanted&#8221;. If we flag it, we can then facet/filter on that row from the All menu:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/facet-on-flagged-row.png"><img src="http://ouseful.files.wordpress.com/2013/05/facet-on-flagged-row.png?w=700&#038;h=212" alt="facet on flagged row" width="700" height="212" class="alignnone size-full wp-image-10520" /></a></p>
<p>Then we can Remove all matching rows from the cell menu as we did above, then remove the facet.</p>
<p>Now we can turn to just getting the data relating to votes cast per candidate (we could also leave in the other returns). Let&#8217;s use a trick we&#8217;ve already used before &#8211; facet by numeric:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/remove-header-rows.png"><img src="http://ouseful.files.wordpress.com/2013/05/remove-header-rows.png?w=700" alt="Remove header rows"   class="alignnone size-full wp-image-10519" /></a></p>
<p>And then this time just retain the non-numeric rows.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/electoral-ward-properties.png"><img src="http://ouseful.files.wordpress.com/2013/05/electoral-ward-properties.png?w=700&#038;h=239" alt="Electoral ward properties" width="700" height="239" class="alignnone size-full wp-image-10518" /></a></p>
<p>Hmmm..before we remove it, this data could be worth keeping too in its own right? Let&#8217;s rename the columns:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/rename-column.png"><img src="http://ouseful.files.wordpress.com/2013/05/rename-column.png?w=700" alt="Rename column"   class="alignnone size-full wp-image-10517" /></a></p>
<p>Like so:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/columns-renamed.png"><img src="http://ouseful.files.wordpress.com/2013/05/columns-renamed.png?w=700" alt="columns renamed"   class="alignnone size-full wp-image-10516" /></a></p>
<p>Now let&#8217;s just make those comma mangled numbers into numbers, by transforming them:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/transform-the-cells-by-removeing-commas.png"><img src="http://ouseful.files.wordpress.com/2013/05/transform-the-cells-by-removeing-commas.png?w=700" alt="transform the cells by removeing commas"   class="alignnone size-full wp-image-10515" /></a></p>
<p>The transform we&#8217;re going to use is to replace the comma by nothing:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/replace-comma.png"><img src="http://ouseful.files.wordpress.com/2013/05/replace-comma.png?w=700" alt="replace comma"   class="alignnone size-full wp-image-10514" /></a></p>
<p>Then convert the values to a number type.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/then-convert-to-number.png"><img src="http://ouseful.files.wordpress.com/2013/05/then-convert-to-number.png?w=700" alt="then convert to number"   class="alignnone size-full wp-image-10513" /></a></p>
<p>We can the do the same thing for the Number on Roll column:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/reuse-is-good.png"><img src="http://ouseful.files.wordpress.com/2013/05/reuse-is-good.png?w=700" alt="reuse is good"   class="alignnone size-full wp-image-10512" /></a></p>
<p>We seem to have a rogue row in there too &#8211; a Labour candidate with a 0% poll. We can flag that row and delete it as we did above.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/final-stages-of-electroal-division-data.png"><img src="http://ouseful.files.wordpress.com/2013/05/final-stages-of-electroal-division-data.png?w=700&#038;h=274" alt="Final stages of electroal division data" width="700" height="274" class="alignnone size-full wp-image-10511" /></a></p>
<p>There also seem to be a couple of other scrappy rows &#8211; the overall count and another rogue percentage bearing line, so again we can flag these, do an All facet on them, remove all rows and then remove the flag facet.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/a-little-more-tidying-to-do.png"><img src="http://ouseful.files.wordpress.com/2013/05/a-little-more-tidying-to-do.png?w=700" alt="a little more tidying to do"   class="alignnone size-full wp-image-10510" /></a></p>
<p>Having done that, we can take the opportunity to export the data.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/openrefine-exporter.png"><img src="http://ouseful.files.wordpress.com/2013/05/openrefine-exporter.png?w=700" alt="openrefine exporter"   class="alignnone size-full wp-image-10509" /></a></p>
<p>Using the custom tabular exporter, we can select the columns we wish to export.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/export-column-select.png"><img src="http://ouseful.files.wordpress.com/2013/05/export-column-select.png?w=700&#038;h=453" alt="Export column select" width="700" height="453" class="alignnone size-full wp-image-10508" /></a></p>
<p>Then we can export the data to the desktop as a file in a variety of formats:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/openrefine-export-download.png"><img src="http://ouseful.files.wordpress.com/2013/05/openrefine-export-download.png?w=700&#038;h=275" alt="OPenrefine export download" width="700" height="275" class="alignnone size-full wp-image-10506" /></a></p>
<p>Or we can upload it to a Google document store, such as Google Spreadsheets or Google Fusion Tables:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/openrefine-upload-to-goole.png"><img src="http://ouseful.files.wordpress.com/2013/05/openrefine-upload-to-goole.png?w=700" alt="OPenRefine upload to goole"   class="alignnone size-full wp-image-10507" /></a></p>
<p>Here&#8217;s <a href="https://docs.google.com/spreadsheet/ccc?key=0AirrQecc6H_vdG1GNGYtSmxvWmV2Mzg0ZDNDdlhDV1E&amp;usp=sharing">the data I uploaded</a>.</p>
<p>If we go back to the results for candidates by ward, we can export that data too, although I&#8217;d be tempted to do a little bit more tidying, for example by removing the &#8220;Votes won by&#8221; rows, and maybe also the Total Votes Cast column. I&#8217;d probably also rename what is now the Candidates column to something more meaningful! (Can you work out how?!;-)</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/change-filter-settings.png"><img src="http://ouseful.files.wordpress.com/2013/05/change-filter-settings.png?w=700&#038;h=218" alt="change filter settings" width="700" height="218" class="alignnone size-full wp-image-10505" /></a></p>
<p>When we upload the data, we can tweak the column ordering first so that the data makes a little more sense at first glance:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/reorder-columns.png"><img src="http://ouseful.files.wordpress.com/2013/05/reorder-columns.png?w=700&#038;h=457" alt="reorder columns" width="700" height="457" class="alignnone size-full wp-image-10504" /></a></p>
<p>Here&#8217;s what I uploaded to a <a href="https://docs.google.com/spreadsheet/ccc?key=0AirrQecc6H_vdDZzakNidXMtY05rRlF4U0VRd2VjM0E&amp;usp=sharing">Google spreadsheet</a>:</p>
<p><a href="https://docs.google.com/spreadsheet/ccc?key=0AirrQecc6H_vdDZzakNidXMtY05rRlF4U0VRd2VjM0E&amp;usp=sharing"><img src="http://ouseful.files.wordpress.com/2013/05/spreadsheet.png?w=700" alt="Spreadsheet"   class="alignnone size-full wp-image-10503" /></a></p>
<p>[<a href="https://dl.dropboxusercontent.com/u/1156404/IW-elections.google-refine.tar.gz">OpenRefine project file</a>]</p>
<p><em>So &#8211; there you have it&#8230; another OpenRefine walkthrough. Part conversation with the data, part puzzle. As with most puzzles, once you start to learn the tricks, it becomes ever easier&#8230; Or you can start taking on ever more complex puzzles&#8230;</p>
<p>Although you may not realise it, most of the work related to generating raw graphics has now been done. Once the data has a reasonable shape to it, it becomes oven ready, data ready, and is relatively easy to work with.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10500/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10500&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=2Z5KZm7WhbE:hN2t2MgtAJM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=2Z5KZm7WhbE:hN2t2MgtAJM:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=2Z5KZm7WhbE:hN2t2MgtAJM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=2Z5KZm7WhbE:hN2t2MgtAJM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=2Z5KZm7WhbE:hN2t2MgtAJM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=2Z5KZm7WhbE:hN2t2MgtAJM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=2Z5KZm7WhbE:hN2t2MgtAJM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=2Z5KZm7WhbE:hN2t2MgtAJM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=2Z5KZm7WhbE:hN2t2MgtAJM:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/2Z5KZm7WhbE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/03/a-wrangling-example-with-openrefine-making-ready-data/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/onthewight-results.png" medium="image">
			<media:title type="html">onthewight results</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/slightly-tidier.png" medium="image">
			<media:title type="html">Slightly tidier</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/turnout.png" medium="image">
			<media:title type="html">turnout</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/paste-data-into-openrefine.png" medium="image">
			<media:title type="html">Paste data into OpenRefine</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/import-data-as-tsv-no-blanks.png" medium="image">
			<media:title type="html">import data as TSV no blanks</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/election-data-raw-import.png" medium="image">
			<media:title type="html">ELection data raw import</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/copy-a-column.png" medium="image">
			<media:title type="html">COpy a column</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/create-new-col-as-copy-of-old.png" medium="image">
			<media:title type="html">Create new col as copy of old</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/facet-the-numbers.png" medium="image">
			<media:title type="html">Facet the numbers</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/filter-and-blank.png" medium="image">
			<media:title type="html">filter and blank</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/filter-update.png" medium="image">
			<media:title type="html">filter update</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/much-tidier.png" medium="image">
			<media:title type="html">Much tidier</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/selectt-openrefine-filter.png" medium="image">
			<media:title type="html">Selectt OpenRefine filter</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/choose-rows-then-blitz-them.png" medium="image">
			<media:title type="html">CHoose rows then blitz them</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/then-remove-the-filter.png" medium="image">
			<media:title type="html">then remove the filter</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/fill-down-on-electoral-division.png" medium="image">
			<media:title type="html">Fill down on Electoral Division</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/filled-down-now-flag-unwanted-row.png" medium="image">
			<media:title type="html">Filled down - now flag unwanted row</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/facet-on-flagged-row.png" medium="image">
			<media:title type="html">facet on flagged row</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/remove-header-rows.png" medium="image">
			<media:title type="html">Remove header rows</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/electoral-ward-properties.png" medium="image">
			<media:title type="html">Electoral ward properties</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/rename-column.png" medium="image">
			<media:title type="html">Rename column</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/columns-renamed.png" medium="image">
			<media:title type="html">columns renamed</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/transform-the-cells-by-removeing-commas.png" medium="image">
			<media:title type="html">transform the cells by removeing commas</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/replace-comma.png" medium="image">
			<media:title type="html">replace comma</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/then-convert-to-number.png" medium="image">
			<media:title type="html">then convert to number</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/reuse-is-good.png" medium="image">
			<media:title type="html">reuse is good</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/final-stages-of-electroal-division-data.png" medium="image">
			<media:title type="html">Final stages of electroal division data</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/a-little-more-tidying-to-do.png" medium="image">
			<media:title type="html">a little more tidying to do</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/openrefine-exporter.png" medium="image">
			<media:title type="html">openrefine exporter</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/export-column-select.png" medium="image">
			<media:title type="html">Export column select</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/openrefine-export-download.png" medium="image">
			<media:title type="html">OPenrefine export download</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/openrefine-upload-to-goole.png" medium="image">
			<media:title type="html">OPenRefine upload to goole</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/change-filter-settings.png" medium="image">
			<media:title type="html">change filter settings</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/reorder-columns.png" medium="image">
			<media:title type="html">reorder columns</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/spreadsheet.png" medium="image">
			<media:title type="html">Spreadsheet</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/03/a-wrangling-example-with-openrefine-making-ready-data/</feedburner:origLink></item>
		<item>
		<title>UK Local Elections 2013 – Live Data, Live Results Maps…</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/YGoA5X_3DO8/</link>
		<comments>http://blog.ouseful.info/2013/05/02/uk-local-elections-2013-live-data-live-maps/#comments</comments>
		<pubDate>Thu, 02 May 2013 14:47:07 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Anything you want]]></category>
		<category><![CDATA[election]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10466</guid>
		<description>I wonder whether this will be the last round of elections without a national live data feed from somewhere pushing out the results in a standardised form? So far, here are the local &amp;#8220;live election data&amp;#8221; initiatives I&amp;#8217;ve spotted/had pointed out to me: Lincolnshire The Lincolnite &amp;#8211; Lincolnshire Local Elections 2013, described here: The Lincolnite [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10466&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>I wonder whether this will be the last round of elections without a national live data feed from somewhere pushing out the results in a standardised form? So far, here are the local &#8220;live election data&#8221; initiatives I&#8217;ve spotted/had pointed out to me:</p>
<p><strong>Lincolnshire</strong></p>
<p>The Lincolnite &#8211; <a href="http://thelincolnite.co.uk/elections/">Lincolnshire Local Elections 2013</a>, described here: <a href="http://www.journalism.co.uk/news/hyperlocal-site-the-lincolnite-cover-elections-live-interactive-map/s2/a552859/">The Lincolnite to cover elections live with interactive map</a>. (Ex-?) University of Lincoln developer Alex Bilbie (@alexbilbie), who built the Lincolnshire map app, describes a little of the process behind it here <a href="http://alexbilbie.com/2013/04/developing-an-interactive-county-council-election-map-part-one/">Developing an interactive county council election map (part one)</a>.</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/licolnshore-live-election-map.png"><img src="http://ouseful.files.wordpress.com/2013/05/licolnshore-live-election-map.png?w=700&#038;h=798" alt="Lincolnshore live election map" width="700" height="798" class="alignnone size-full wp-image-10468" /></a></p>
<p><strong>Warwickshire</strong></p>
<p><a href="http://www.warwickshire.gov.uk/2013elections">2013 Elections: Warwickshire area</a>, described here: <a href="http://innovatewarwickshire.wordpress.com/2013/05/02/2013-elections-in-real-time/">2013 Elections – In Real Time</a>.</p>
<p><a href="http://innovatewarwickshire.wordpress.com/2013/05/02/2013-elections-in-real-time/"><img src="http://ouseful.files.wordpress.com/2013/05/warwickshire-live-election-map.png?w=700&#038;h=668" alt="warwickshire live election map" width="700" height="668" class="alignnone size-full wp-image-10467" /></a></p>
<p>The Warwickshire team are also making shapefiles/KML files (for the plotting of boundary line maps) and live results data (via Google Fusion Tables) too, as well as making data available about previously elected candidates: <a href="http://innovatewarwickshire.wordpress.com/2013/05/02/2013-elections-in-real-time/">2013 Elections – In Real Time</a></p>
<p>Here&#8217;s the map after the fact&#8230; I like the clear statement of seats by part in the bottom left corner too&#8230;</p>
<p><a><img src="http://ouseful.files.wordpress.com/2013/05/warwickshire.png?w=700&#038;h=605" alt="Warwickshire" width="700" height="605" class="alignnone size-full wp-image-10494" /></a></p>
<p><strong>Surrey</strong></p>
<p>Surrey has the <a href="http://electionsdashboard.surreycc.gov.uk/">Surrey elections dashboard</a> (via @BenUnsworth) that will switch to a live map as the results come in, but currently offers a search box that accepts a postcode and then tells you who your candidates are and where you can vote:</p>
<p><a href="http://electionsdashboard.surreycc.gov.uk/default.aspx?eldiv=39&amp;postcode=GU2%207JP&amp;house="><img src="http://ouseful.files.wordpress.com/2013/05/surrey-elections-dashboard.png?w=700&#038;h=751" alt="Surrey elections dashboard" width="700" height="751" class="alignnone size-full wp-image-10473" /></a></p>
<p><strong>Kent</strong><br />
This looks pretty, from <a href="http://www.akserps.com/akskentcc/election/2013/console/index.html">Kent County Council</a>:</p>
<p><a href="http://www.akserps.com/akskentcc/election/2013/console/index.html"><img src="http://ouseful.files.wordpress.com/2013/05/kent-live-election-results.png?w=700&#038;h=692" alt="Kent live election results" width="700" height="692" class="alignnone size-full wp-image-10477" /></a></p>
<p>I was looking forward to seeing how this view played out once the results started to come in, but, erm, oops?!</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/oops-kent.png"><img src="http://ouseful.files.wordpress.com/2013/05/oops-kent.png?w=700&#038;h=131" alt="oops - Kent" width="700" height="131" class="alignnone size-full wp-image-10491" /></a></p>
<p>Managing the bursty load on an election results service server is probably something worth building into the planning&#8230;</p>
<p><strong>Bristol</strong><br />
Bristol opted for a tabbed display showing a range of views over their council elecitons results. A simple coloured symbol maps shows the <a href="http://www.bristol.gov.uk/LocalElectionViewer?XSL=main&amp;ShowMaps=true&amp;ElectionId=67">distribution of seats by ward across the parties</a>:</p>
<p><a href="http://www.bristol.gov.uk/LocalElectionViewer?XSL=main&amp;ShowMaps=true&amp;ElectionId=67"><img src="http://ouseful.files.wordpress.com/2013/05/bristol-election-map.png?w=700&#038;h=784" alt="Bristol election map" width="700" height="784" class="alignnone size-full wp-image-10485" /></a></p>
<p>Bristol also provided a view over the turnout:<br />
<a href="http://ouseful.files.wordpress.com/2013/05/bristol-turnout.png"><img src="http://ouseful.files.wordpress.com/2013/05/bristol-turnout.png?w=700&#038;h=774" alt="Bristol turnout" width="700" height="774" class="alignnone size-full wp-image-10486" /></a></p>
<p>(Would it be useful to also be able to see this as percentage turnouts? Or to depict the proportional turnout on a map to see if any geographical reasons jump out as a source of possible differences?)</p>
<p><strong>Cumbria</strong><br />
Cumbria County Council show how to make use of boundary files to mark or &lt;<a href="http://www.cumbria.gov.uk/Election2013/Results/text.asp">choropleth election maps</em> relate the party affiliation of the candidate taking each particular seat by electoral division area:</p>
<p><a href="http://www.cumbria.gov.uk/Election2013/Results/text.asp"><img src="http://ouseful.files.wordpress.com/2013/05/cumbria-election-map.png?w=700&#038;h=760" alt="Cumbria election map" width="700" height="760" class="alignnone size-full wp-image-10488" /></a></p>
<p>Cumbria also provided a view of <a href="http://www.cumbria.gov.uk/Election2013/Results/text.asp">seat allocations in districts</a>; I don&#8217;t understand the scale they used to on the x-axes though? It differs from district to district. For example, it looks to me as if more seats went to Conservatives in Eden than in Carlise? Or is the scale related to the percentage of seats in the district? I&#8217;d class as &#8220;infographic-standard&#8221;, i.e. meaningless as a visualisation;-)<br />
<a href="http://www.cumbria.gov.uk/Election2013/Results/text.asp"><img src="http://ouseful.files.wordpress.com/2013/05/cumbria-district-summary-bad-scales.png?w=700&#038;h=819" alt="Cumbria district summary  - bad scales?" width="700" height="819" class="alignnone size-full wp-image-10487" /></a></p>
<p><strong>Norfolk</strong></p>
<p><a href="http://elections.norfolk.gov.uk/default.aspx">Norfolk&#8217;s election map</a> looks quite, erm, &#8220;child-friendly&#8221; (chunky?! kids TV?) to me?</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/norfolk-election-map.png"><img src="http://ouseful.files.wordpress.com/2013/05/norfolk-election-map.png?w=700&#038;h=501" alt="Norfolk election map" width="700" height="501" class="alignnone size-full wp-image-10490" /></a></p>
<p>Norfolk also produced a graphic showing <a href="http://elections.norfolk.gov.uk/seats.aspx">how seats might be distributed in the chamber:</p>
<p><a href="http://elections.norfolk.gov.uk/seats.aspx"><img src="http://ouseful.files.wordpress.com/2013/05/norfolk-seats.png?w=700&#038;h=427" alt="Norfolk seats" width="700" height="427" class="alignnone size-full wp-image-10489" /></a></p>
<p>I think one of the major issues with this sort of graphic is how you communicate the possible structurings of the chamber based on what sort of affiliations and groupings play out?</p>
<p><strong>Wales Online</strong></p>
<p>Wales online have a nice clean feel to their <a href="http://www.walesonline.co.uk/news/wales-news/counting-begin-anglesey-council-elections-3405894">results map for Anglesey</a>, but what&#8217;s going on with the legend? They don&#8217;t make it easy to get the branding into the screengrab either?!</p>
<p><a href="http://www.walesonline.co.uk/news/wales-news/counting-begin-anglesey-council-elections-3405894"><img src="http://ouseful.files.wordpress.com/2013/05/wales-online-report-anglesey.png?w=700&#038;h=868" alt="Wales online report - Anglesey" width="700" height="868" class="alignnone size-full wp-image-10498" /></a></p>
<p><strong>National Reporting</strong></p>
<p>THe Telegraph produced a <a href="http://www.telegraph.co.uk/news/politics/local-elections/10034832/Local-elections-2013-results-map.html">map showing results of the elections at national scale</a> based on control of councils by party:</p>
<p><a href="http://www.telegraph.co.uk/news/politics/local-elections/10034832/Local-elections-2013-results-map.html"><img src="http://ouseful.files.wordpress.com/2013/05/telegraph.png?w=700&#038;h=616" alt="Telegraph" width="700" height="616" class="alignnone size-full wp-image-10496" /></a></p>
<p>And ever helpful, the Guardian datablog <a href="http://www.guardian.co.uk/news/datablog/2013/may/03/local-elections-results-full">made the data available</a> (will they do data broken down at seat level too, I wonder?) Here&#8217;s <a href="http://www.guardian.co.uk/news/datablog/interactive/2013/may/03/local-election-results-mapped">the map they produced</a>:</p>
<p><a href="http://www.guardian.co.uk/news/datablog/interactive/2013/may/03/local-election-results-mapped"><img src="http://ouseful.files.wordpress.com/2013/05/guardian-elecotion-map.png?w=700&#038;h=540" alt="guardian elecotion map" width="700" height="540" class="alignnone size-full wp-image-10545" /></a></p>
<p>Hmmm&#8230; do I recognise that sort of layout? Ah, I know, it reminds me of this example of <a href="http://blog.ouseful.info/2011/09/13/data-journalists-engaging-in-co-innovation/">Data Journalists Engaging in Co-Innovation…</a> around boundary changes.</p>
<p><strong>Other&#8230;</strong><br />
For lists of current councillors, see <a href="http://openlylocal.com/">OpenlyLocal</a>, which has data available via a JSON API relating to current councillors and their affiliations. (It would be good if a frozen snapshot of this could be grabbed today, for comparison with the results following today&#8217;s election?)</p>
<p>This may also be of interest&#8230; UK Data Service <a href="http://discover.ukdataservice.ac.uk/catalogue/?sn=5319&amp;type=Data%20catalogue">British Local Election Database, 1889-2003</a> and Andrew Teale&#8217;s <a href="http://www.andrewteale.me.uk/leap/downloads">Local Elections Archive Project</a>.</p>
<p>Data relating to general elections can be found on the Electoral Commission website: <a href="http://www.electoralcommission.org.uk/elections/results/general_elections">General Elections</a>. TheyWorkForYou provide an API over current MPs by constituency, and MySOciety also produce the MapIt service for accessing constituency and electoral division boundary line data files.</p>
<p><em>If you&#8217;re interested in doing something data related around the election, or would like to learn how to do something with the data generated by the election, check out this <a href="https://docs.google.com/document/d/1PcKpc3BKuR3lZrsRMHYcRA9YxL44raQbijEFv9NBnU0/edit?usp=sharing">informal resource co-ordination document</a>. If you&#8217;re interested in checking out your local council website to see whether they publish any #opendata that would help you generate you own live maps, dashboards or consoles, the School of Data post &#8220;wot I wrote&#8221; on <a href="http://schoolofdata.org/2013/05/02/proving-the-data-a-quick-guide-to-mapping-local-elections/">Proving the Data – A Quick Guide to Mapping England and Wales Local Elections</a> may provide you with a quick start guide to making use of some of it&#8230;</em></p>
<p><em><strong>If you know of any other councils or local presses publishing election related data warez, maps, live data feeds, etc, please post a link and brief description in the comments, and I&#8217;ll try to keep this post up to date&#8230;</strong></em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10466/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10466/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10466&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=YGoA5X_3DO8:XKVze2XPooo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=YGoA5X_3DO8:XKVze2XPooo:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=YGoA5X_3DO8:XKVze2XPooo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=YGoA5X_3DO8:XKVze2XPooo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=YGoA5X_3DO8:XKVze2XPooo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=YGoA5X_3DO8:XKVze2XPooo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=YGoA5X_3DO8:XKVze2XPooo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=YGoA5X_3DO8:XKVze2XPooo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=YGoA5X_3DO8:XKVze2XPooo:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/YGoA5X_3DO8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/02/uk-local-elections-2013-live-data-live-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/licolnshore-live-election-map.png" medium="image">
			<media:title type="html">Lincolnshore live election map</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/warwickshire-live-election-map.png" medium="image">
			<media:title type="html">warwickshire live election map</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/warwickshire.png" medium="image">
			<media:title type="html">Warwickshire</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/surrey-elections-dashboard.png" medium="image">
			<media:title type="html">Surrey elections dashboard</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/kent-live-election-results.png" medium="image">
			<media:title type="html">Kent live election results</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/oops-kent.png" medium="image">
			<media:title type="html">oops - Kent</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/bristol-election-map.png" medium="image">
			<media:title type="html">Bristol election map</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/bristol-turnout.png" medium="image">
			<media:title type="html">Bristol turnout</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/cumbria-election-map.png" medium="image">
			<media:title type="html">Cumbria election map</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/cumbria-district-summary-bad-scales.png" medium="image">
			<media:title type="html">Cumbria district summary  - bad scales?</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/norfolk-election-map.png" medium="image">
			<media:title type="html">Norfolk election map</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/norfolk-seats.png" medium="image">
			<media:title type="html">Norfolk seats</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/wales-online-report-anglesey.png" medium="image">
			<media:title type="html">Wales online report - Anglesey</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/telegraph.png" medium="image">
			<media:title type="html">Telegraph</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/guardian-elecotion-map.png" medium="image">
			<media:title type="html">guardian elecotion map</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/02/uk-local-elections-2013-live-data-live-maps/</feedburner:origLink></item>
		<item>
		<title>Boundary Files for Electoral Wards Covered by a Particular Geography</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/BUjAe8zFtYI/</link>
		<comments>http://blog.ouseful.info/2013/05/02/shapefiles-for-electoral-wards-covered-by-a-particular-geography/#comments</comments>
		<pubDate>Thu, 02 May 2013 09:02:21 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[Anything you want]]></category>
		<category><![CDATA[kml]]></category>
		<category><![CDATA[mapit]]></category>
		<category><![CDATA[scraperwiki]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10457</guid>
		<description>A week or so ago, I went looking for boundary lines for UK electoral wards, with half a mind towards trying to do something with them related to this week&amp;#8217;s local council elections. One source I came across was the UK 2011 Census, (2011 Census geography products for England and Wales) which publishes the appropriate [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10457&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>A week or so ago, I went looking for boundary lines for UK electoral wards, with half a mind towards trying to do something with them related to <a href="http://fullfact.org/articles/local_elections_factsheet_may_2013-28903">this week&#8217;s local council elections</a>. One source I came across was the UK 2011 Census, (<a href="http://www.ons.gov.uk/ons/guide-method/geography/products/census/index.html">2011 Census geography products for England and Wales</a>) which publishes the appropriate data from across England and Wales in large single shapefiles. For the amateur cartographer (which I very much am!) wanting to work at a local level, this presents something of a challenge: not only do I have to find a way of downloading and opening the large dataset, I also need to find a way of extracting from it the data for my local area, which is what I actually want. (Getting the local data from the national dataset can be blocking, in other words.)</p>
<p>Another source of data is MySociety&#8217;s <a href="http://mapit.mysociety.org/">MapIt</a> service, which provides data about various geographies, including electoral wards, covered by other geographical areas:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/mapit-areas-covered.png"><img src="http://ouseful.files.wordpress.com/2013/05/mapit-areas-covered.png?w=700&#038;h=516" alt="mapit areas covered" width="700" height="516" class="alignnone size-full wp-image-10459" /></a></p>
<p>as well as boundary files for each geography in a variety of formats:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/mapit-geometry.png"><img src="http://ouseful.files.wordpress.com/2013/05/mapit-geometry.png?w=700&#038;h=532" alt="Mapit Geometry" width="700" height="532" class="alignnone size-full wp-image-10458" /></a></p>
<p>Unfortunately, the MapIt API doesn&#8217;t (yet?!) support the ability to generate a single file that contains boundary data for all the electoral wards in a single council or local authority area. So here&#8217;s a quick hack, posted as a view on Scraperwiki, that generates a single KML file for the electoral wards contained by a council area (including the wider boundary of that council area) &#8211; <a href="https://scraperwiki.com/views/kml_merge_test/">KML Merge Test</a>. (There are probably better ways of doing this?! I would if I should try to make sense of the <a href="https://github.com/mysociety/mapit">MapIt code</a> to see if I can work out how to submit a proper patch&#8230;)</p>
<pre class="brush: python; title: ; notranslate">import scraperwiki,simplejson,urllib2
from lxml import etree
from copy import deepcopy


#--via @mhawksey
# query string crib https://views.scraperwiki.com/run/python_querystring_cheat_sheet/?
import cgi, os
qstring=os.getenv(&quot;QUERY_STRING&quot;)

key='65791' #Use the Isle of Wight as a default
typ='UTE'
#typs are:
#CTY (county council), CED (county ward), COI (Isles of Scilly), COP (Isles of Scilly parish), CPC (civil parish/community), CPW (civil parish/community ward), DIS (district council), DIW (district ward), EUR (Euro region), GLA (London Assembly), LAC (London Assembly constituency), LBO (London borough), LBW (London ward), LGD (NI council), LGE (NI electoral area), LGW (NI ward), MTD (Metropolitan district), MTW (Metropolitan ward), NIE (NI Assembly constituency), OLF (Lower Layer Super Output Area, Full), OLG (Lower Layer Super Output Area, Generalised), OMF (Middle Layer Super Output Area, Full), OMG (Middle Layer Super Output Area, Generalised), SPC (Scottish Parliament constituency), SPE (Scottish Parliament region), UTA (Unitary authority), UTE (Unitary authority electoral division), UTW (Unitary authority ward), WAC (Welsh Assembly constituency), WAE (Welsh Assembly region), WMC (UK Parliamentary constituency)

if qstring!=None:
    get = dict(cgi.parse_qsl(qstring))
    if 'key' in get: key=get['key']
    if 'typ' in get: typ=get['typ'] 
#---


#Get a stub KML file for the local council level
url='http://mapit.mysociety.org/area/'+str(key)+'.kml'
xmlraw = urllib2.urlopen(url).read()
xml=etree.fromstring(xmlraw)

#Get the list of electoral wards covered by that council area
wards=simplejson.load(urllib2.urlopen('http://mapit.mysociety.org/area/'+str(key)+'/covers?type='+typ))

#Get the KML for each ward, extract the Placemark data, and add it to our comprehensive KML tree
for ward in wards:
    url='http://mapit.mysociety.org/area/'+ward+'.kml'
    xmlraw = scraperwiki.scrape(url)
    xml2=etree.fromstring(xmlraw)
    p= xml2.xpath('//geo:Placemark',namespaces={'geo':'http://www.opengis.net/kml/2.2'})
    xml.append( deepcopy(p[0] ))

scraperwiki.utils.httpresponseheader(&quot;Content-Type&quot;, &quot;text/xml&quot;)
print etree.tostring(xml)</pre>
<p>The key value is the ID of the council area within which you want to find the electoral wards. So for example the Isle of Wight parliamentary constituency page -http://mapit.mysociety.org/area/65791.html &#8211; gives us the ID <em>65791</em>, which we pass as an argument to the Scraperwiki view. The subdivision we want to grab data for is given by the <tt>typ</tt> parameter:</p>
<p><em>CTY (county council), CED (county ward), COI (Isles of Scilly), COP (Isles of Scilly parish), CPC (civil parish/community), CPW (civil parish/community ward), DIS (district council), DIW (district ward), EUR (Euro region), GLA (London Assembly), LAC (London Assembly constituency), LBO (London borough), LBW (London ward), LGD (NI council), LGE (NI electoral area), LGW (NI ward), MTD (Metropolitan district), MTW (Metropolitan ward), NIE (NI Assembly constituency), OLF (Lower Layer Super Output Area, Full), OLG (Lower Layer Super Output Area, Generalised), OMF (Middle Layer Super Output Area, Full), OMG (Middle Layer Super Output Area, Generalised), SPC (Scottish Parliament constituency), SPE (Scottish Parliament region), UTA (Unitary authority), UTE (Unitary authority electoral division), UTW (Unitary authority ward), WAC (Welsh Assembly constituency), WAE (Welsh Assembly region), WMC (UK Parliamentary constituency)</em></p>
<p>So for example, here&#8217;s a link to an aggregate KML file for Unitary authority electoral divisions (UTE) on the Isle of Wight &#8211; <em><a href="https://views.scraperwiki.com/run/kml_merge_test/?key=65791" rel="nofollow">https://views.scraperwiki.com/run/kml_merge_test/?key=65791</a></em>; and here&#8217;s one for Unitary authority wards (UTW) in Milton Keynes: <a href="https://views.scraperwiki.com/run/kml_merge_test/?key=2588&#038;typ=UTW" rel="nofollow">https://views.scraperwiki.com/run/kml_merge_test/?key=2588&#038;typ=UTW</a></p>
<p>If you save the resulting file as a <em>.kml</em> file (for example, as <em>kml_merge_test_mk.kml</em>) you can then load it into something like Google Fusion tables to view it:</p>
<p><a href="http://ouseful.files.wordpress.com/2013/05/google-fusion-table-map.png"><img src="http://ouseful.files.wordpress.com/2013/05/google-fusion-table-map.png?w=700&#038;h=631" alt="GOogle fusion table map" width="700" height="631" class="alignnone size-full wp-image-10460" /></a></p>
<p>Note that the MapIt API is rate limited (I think), so be gentle ;-)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10457/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10457&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=BUjAe8zFtYI:MSR1lW8Xv4Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=BUjAe8zFtYI:MSR1lW8Xv4Y:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=BUjAe8zFtYI:MSR1lW8Xv4Y:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=BUjAe8zFtYI:MSR1lW8Xv4Y:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=BUjAe8zFtYI:MSR1lW8Xv4Y:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=BUjAe8zFtYI:MSR1lW8Xv4Y:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=BUjAe8zFtYI:MSR1lW8Xv4Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=BUjAe8zFtYI:MSR1lW8Xv4Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=BUjAe8zFtYI:MSR1lW8Xv4Y:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/BUjAe8zFtYI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/02/shapefiles-for-electoral-wards-covered-by-a-particular-geography/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/mapit-areas-covered.png" medium="image">
			<media:title type="html">mapit areas covered</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/mapit-geometry.png" medium="image">
			<media:title type="html">Mapit Geometry</media:title>
		</media:content>

		<media:content url="http://ouseful.files.wordpress.com/2013/05/google-fusion-table-map.png" medium="image">
			<media:title type="html">GOogle fusion table map</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/02/shapefiles-for-electoral-wards-covered-by-a-particular-geography/</feedburner:origLink></item>
		<item>
		<title>Simple Map Making With Google Fusion Tables</title>
		<link>http://feedproxy.google.com/~r/ouseful/~3/es7H4qFvxZg/</link>
		<comments>http://blog.ouseful.info/2013/05/01/simple-map-making-with-google-fusion-tables/#comments</comments>
		<pubDate>Wed, 01 May 2013 21:03:29 +0000</pubDate>
		<dc:creator>Tony Hirst</dc:creator>
				<category><![CDATA[School_Of_Data]]></category>
		<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[Fusion Table]]></category>
		<category><![CDATA[Google Fusion Table]]></category>
		<category><![CDATA[recipe]]></category>

		<guid isPermaLink="false">http://blog.ouseful.info/?p=10450</guid>
		<description>A quicker than quick recipe to make a map from a list of addresses in a simple text file using Google Fusion tables&amp;#8230; Here&amp;#8217;s some data (grabbed from The Gravesend Reporter via this recipe) in a simple two column CSV format; the first column contains address data. Here&amp;#8217;s what it looks like when I import [&amp;#8230;]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&amp;#038;blog=325417&amp;#038;post=10450&amp;#038;subd=ouseful&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description>
				<content:encoded><![CDATA[<p>A quicker than quick recipe to make a map from a list of addresses in a simple text file using Google Fusion tables&#8230;</p>
<p><a href="https://dl.dropboxusercontent.com/u/1156404/gravesendPollingStations.csv">Here&#8217;s some data</a> (grabbed from <a href="http://www.gravesendreporter.co.uk/news/find_your_polling_station_ahead_of_the_kent_county_council_elections_1_2174988">The Gravesend Reporter</a> via <a href="http://blog.ouseful.info/2013/05/01/a-simple-openrefine-example-tidying-cutnpaste-data-from-a-web-page/">this recipe</a>) in a simple two column CSV format; the first column contains address data. Here&#8217;s what it looks like when I import it into Google Fusion Tables:</p>
<p><a href="http://www.flickr.com/photos/psychemedia/8698522451/" title="data in a fusion table by psychemedia, on Flickr"><img src="http://farm9.staticflickr.com/8134/8698522451_dcf1c1a51e_z.jpg" width="640" height="193" alt="data in a fusion table"></a></p>
<p>Now let&#8217;s map it:-)</p>
<p>First of all we need to tell the application which column contains the data we want to geocode &#8211; that is, the addrerss we want Fusion Tables to find the latitude and longitude co-ordinates for&#8230;</p>
<p><a href="http://www.flickr.com/photos/psychemedia/8699647770/" title="tweak the column by psychemedia, on Flickr"><img src="http://farm9.staticflickr.com/8536/8699647770_beddbd001c.jpg" width="330" height="236" alt="tweak the column"></a></p>
<p>Then we say we want the column to be recognised as a column type:</p>
<p><a href="http://www.flickr.com/photos/psychemedia/8699652382/" title="change name make location by psychemedia, on Flickr"><img src="http://farm9.staticflickr.com/8263/8699652382_610512e32d.jpg" width="500" height="363" alt="change name make location"></a></p>
<p>Computer says yes, highlighting the location type cells with a yellow background:</p>
<p><a href="http://www.flickr.com/photos/psychemedia/8699653502/" title="fusion table.. yellow... by psychemedia, on Flickr"><img src="http://farm9.staticflickr.com/8551/8699653502_f42978c6d9.jpg" width="488" height="324" alt="fusion table.. yellow..."></a></p>
<p>As if by magic a Map tab appears (though possibly not if you are using Google Fusion Tables as apart of a Google Apps account&#8230;) The geocoder also accepts hints, so we can make life easier for it by providing one;-)</p>
<p><a href="http://www.flickr.com/photos/psychemedia/8699657324/" title="map tab... by psychemedia, on Flickr"><img src="http://farm9.staticflickr.com/8115/8699657324_cbc17b648f_z.jpg" width="640" height="335" alt="map tab..."></a></p>
<p>Once the points have been geocoded, they&#8217;re placed onto a map:</p>
<p><a href="http://www.flickr.com/photos/psychemedia/8699661716/" title="mapped by psychemedia, on Flickr"><img src="http://farm9.staticflickr.com/8115/8699661716_ff9a6c0973.jpg" width="455" height="460" alt="mapped"></a></p>
<p>We can now publish the map in preparation for sharing it with the world&#8230;</p>
<p><a href="http://www.flickr.com/photos/psychemedia/8698539091/" title="publish map by psychemedia, on Flickr"><img src="http://farm9.staticflickr.com/8260/8698539091_21ed56f84c.jpg" width="259" height="258" alt="publish map"></a></p>
<p>We need to change the visibility of the map to something folk can see!</p>
<p><a href="http://www.flickr.com/photos/psychemedia/8698544583/" title="privacy and link by psychemedia, on Flickr"><img src="http://farm9.staticflickr.com/8259/8698544583_4a53f5901a.jpg" width="453" height="316" alt="privacy and link"></a></p>
<p>Public on the web, or just via a shared link &#8211; your choice:</p>
<p><a href="http://www.flickr.com/photos/psychemedia/8699669550/" title="make seeable by psychemedia, on Flickr"><img src="http://farm9.staticflickr.com/8267/8699669550_f5f00e8c69.jpg" width="496" height="313" alt="make seeable"></a></p>
<p><a href="https://www.google.com/fusiontables/DataSource?docid=1dofdML42B5Jd5wjOgYRI9q-5CmxXejZmM4Bf2CY">Here&#8217;s my map:-)</a></p>
<p><em>The data used to generate this map was originally grabbed from the Gravesend Reporter: <a href="http://www.gravesendreporter.co.uk/news/find_your_polling_station_ahead_of_the_kent_county_council_elections_1_2174988">Find your polling station ahead of the Kent County Council elections</a>. A walkthrough of how the data was prepared can be found here: <a href="http://blog.ouseful.info/2013/05/01/a-simple-openrefine-example-tidying-cutnpaste-data-from-a-web-page/">A Simple OpenRefine Example – Tidying Cut’n&#8217;Paste Data from a Web Page</a>.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ouseful.wordpress.com/10450/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ouseful.wordpress.com/10450/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ouseful.info&#038;blog=325417&#038;post=10450&#038;subd=ouseful&#038;ref=&#038;feed=1" width="1" height="1" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ouseful?a=es7H4qFvxZg:qynPV_t70Jw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ouseful?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=es7H4qFvxZg:qynPV_t70Jw:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=2mJPEYqXBVI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=es7H4qFvxZg:qynPV_t70Jw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ouseful?i=es7H4qFvxZg:qynPV_t70Jw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=es7H4qFvxZg:qynPV_t70Jw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/ouseful?i=es7H4qFvxZg:qynPV_t70Jw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=es7H4qFvxZg:qynPV_t70Jw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ouseful?i=es7H4qFvxZg:qynPV_t70Jw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ouseful?a=es7H4qFvxZg:qynPV_t70Jw:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/ouseful?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ouseful/~4/es7H4qFvxZg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.ouseful.info/2013/05/01/simple-map-making-with-google-fusion-tables/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abbd9f90565ce9ae4d065d93a81d8c03?s=96&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Tony Hirst</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8134/8698522451_dcf1c1a51e_z.jpg" medium="image">
			<media:title type="html">data in a fusion table</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8536/8699647770_beddbd001c.jpg" medium="image">
			<media:title type="html">tweak the column</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8263/8699652382_610512e32d.jpg" medium="image">
			<media:title type="html">change name make location</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8551/8699653502_f42978c6d9.jpg" medium="image">
			<media:title type="html">fusion table.. yellow...</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8115/8699657324_cbc17b648f_z.jpg" medium="image">
			<media:title type="html">map tab...</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8115/8699661716_ff9a6c0973.jpg" medium="image">
			<media:title type="html">mapped</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8260/8698539091_21ed56f84c.jpg" medium="image">
			<media:title type="html">publish map</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8259/8698544583_4a53f5901a.jpg" medium="image">
			<media:title type="html">privacy and link</media:title>
		</media:content>

		<media:content url="http://farm9.staticflickr.com/8267/8699669550_f5f00e8c69.jpg" medium="image">
			<media:title type="html">make seeable</media:title>
		</media:content>
	<feedburner:origLink>http://blog.ouseful.info/2013/05/01/simple-map-making-with-google-fusion-tables/</feedburner:origLink></item>
	</channel>
</rss>
