<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Michalis Avraam &#187; io model</title>
	<atom:link href="http://michalisavraam.org/tag/io-model/feed/" rel="self" type="application/rss+xml" />
	<link>http://michalisavraam.org</link>
	<description>intersecting space and time through gis endeavors</description>
	<lastBuildDate>Wed, 08 Sep 2010 20:03:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Python and Geography: Input Output Models and Graph Theory</title>
		<link>http://michalisavraam.org/2009/05/python-and-geography-input-output-models-and-graph-theory/</link>
		<comments>http://michalisavraam.org/2009/05/python-and-geography-input-output-models-and-graph-theory/#comments</comments>
		<pubDate>Wed, 20 May 2009 03:50:34 +0000</pubDate>
		<dc:creator>Michalis Avraam</dc:creator>
				<category><![CDATA[GIS* Points]]></category>
		<category><![CDATA[Python Points]]></category>
		<category><![CDATA[economic geography]]></category>
		<category><![CDATA[graph theory]]></category>
		<category><![CDATA[input output model]]></category>
		<category><![CDATA[io model]]></category>
		<category><![CDATA[networkx]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[washington io model]]></category>

		<guid isPermaLink="false">http://michalisavraam.org/blog/38-blog-entries/54-geopy-graph</guid>
		<description><![CDATA[As may be evident from my other posts in the past, I have a tendency to use Python to solve a lot of the problems I face every day doing research in Geography. In that context, analyzing the 2002 Input Output Model for Washington State, I decided that Graph Theory needs to come into play <a href='http://michalisavraam.org/2009/05/python-and-geography-input-output-models-and-graph-theory/'>[...]</a>


Related posts:<ol><li><a href='http://michalisavraam.org/2010/04/the-essential-python-modules-for-gis/' rel='bookmark' title='Permanent Link: The Essential Python Modules for GIS'>The Essential Python Modules for GIS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As may be evident from my other posts in the past, I have a tendency to use Python to solve a lot of the problems I face every day doing research in Geography. In that context, analyzing the <a title="WA State 2002 Input Output Model" href="http://www.ofm.wa.gov/economy/io/2002/default.asp">2002 Input Output Model for Washington State</a>, I decided that <a title="Wikipedia: Graph Theory" href="http://en.wikipedia.org/wiki/Graph_theory">Graph Theory</a> needs to come into play (Economic Geograhy seems to need more Python(s) around).<span id="more-21"></span></p>
<p>In order to achieve this, I used the Excel Spreadsheet provided by the Washington State Office of Financial Management (OFM) and Python in the following way:</p>
<ol>
<li>Using the excellent <a title="xlrd Python module for reading Excel files" href="http://www.lexicon.net/sjmachin/xlrd.htm">xlrd</a> python module to read Excel data into Python</li>
<li>Create a multi-node directed graph from the data using <a title="NetworkX Python module for graphs" href="http://networkx.lanl.gov/">NetworkX</a></li>
<li>With the amazing power of Python, calculate the Adjacency and Distance Matrices of the graph</li>
<li>Use <a title="xlwt Python module for writing Excel files" href="https://secure.simplistix.co.uk/svn/xlwt/trunk/">xlwd</a> to write back information in an Excel sheet</li>
</ol>
<p>The results were stunning. The 50&#215;50 matrix of the Washington I/O Model with 2,050 actual transactions takes a little more than a second to generate all the outputs given the Excel spreadsheet. Python to the rescue again, performing the work of geographers in a simple, fast way.</p>
<p>Here is a sample image, generating a directed grap (DiGraph) of the first 10 sectors reported in the Washington State Input Output Model for 2002 (the choice of 10 was to ensure a small, less complex graph so people can see the results better). All transactions are considered, with direction preserved.</p>
<p>The graph above is further analyzed using an adjacency matrix and a distance matrix, reported out as an Excel file.</p>
<p>I will be posting more results soon, and if anyone asks for it, I will clean up the script for release into the wild.</p>
<p><img class="aligncenter size-full wp-image-48" title="iograph10" src="http://michalisavraam.org/wp-content/uploads/2009/05/iograph10.png" alt="iograph10" width="800" height="600" /></p>
Note: There is a rating embedded within this post, please visit this post to rate it.


<p>Related posts:<ol><li><a href='http://michalisavraam.org/2010/04/the-essential-python-modules-for-gis/' rel='bookmark' title='Permanent Link: The Essential Python Modules for GIS'>The Essential Python Modules for GIS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://michalisavraam.org/2009/05/python-and-geography-input-output-models-and-graph-theory/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

