Editing Machine Learning/Kaggle Social Network Contest/load data
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
== How to load the network into networkx == | == How to load the network into networkx == | ||
There is a network analysis package for Python called [http://networkx.lanl.gov/ networkx]. This package can be installed using easy_install. | There is a network analysis package for Python called [http://networkx.lanl.gov/ networkx]. This package can be installed using easy_install. | ||
Line 22: | Line 4: | ||
The network can be loaded using the [http://networkx.lanl.gov/reference/generated/networkx.read_edgelist.html read_edgelist] function in networkx or by manually adding edges | The network can be loaded using the [http://networkx.lanl.gov/reference/generated/networkx.read_edgelist.html read_edgelist] function in networkx or by manually adding edges | ||
Method 1 | |||
<pre> | <pre> | ||
import networkx as nx | import networkx as nx | ||
Line 30: | Line 10: | ||
</pre> | </pre> | ||
Method 2 | |||
<pre> | <pre> | ||
import networkx as nx | import networkx as nx | ||
Line 50: | Line 32: | ||
</pre> | </pre> | ||
{| border="1" | |||
{| border="1" | |||
|- | |- | ||
!|Rows | !|Rows | ||
Line 68: | Line 49: | ||
| 86s | | 86s | ||
|} | |} | ||