15.08.2015 Views

Introduction to the Modeling and Analysis of Complex Systems

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

15.5. IMPORTING/EXPORTING NETWORK DATA 319JessJoshJillJeffJohnJaneJackFigure 15.9: Visual output <strong>of</strong> Code 15.16.One useful feature <strong>of</strong> read_edgelist is that it can import not only edges but also <strong>the</strong>irproperties, such as:Code 15.18:John Jane {’weight’: 0.8}John Jack {’weight’: 0.8, ’trust’: 1.5}Jess Josh {’weight’: 0.2}Jess Jill {’trust’: 2.0}Jack Jane {’weight’: 1.0}The third column <strong>of</strong> this data file is structured as a Python dictionary, which will be importedas <strong>the</strong> property <strong>of</strong> <strong>the</strong> edge.Exercise 15.12 Create a data file <strong>of</strong> <strong>the</strong> social network you created in Exercise15.7 using a spreadsheet application, <strong>and</strong> <strong>the</strong>n read <strong>the</strong> file <strong>and</strong> visualize it usingNetworkX. You can use ei<strong>the</strong>r <strong>the</strong> adjacency list format or <strong>the</strong> edge list format.Exercise 15.13 Import network data <strong>of</strong> your choice from Mark Newman’s NetworkData website: http://www-personal.umich.edu/~mejn/netdata/ The dataon this website are all in GML format, so you need <strong>to</strong> figure out how <strong>to</strong> import <strong>the</strong>min<strong>to</strong> NetworkX. Then visualize <strong>the</strong> imported network.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!