io¶
I/O functions for Adjacency objects.
Methods:
| Name | Description |
|---|---|
to_graph | Convert Adjacency into networkx graph. |
write | Write out Adjacency object to csv file. |
Methods¶
to_graph¶
to_graph(adj)Convert Adjacency into networkx graph.
Only works on single matrices for now.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adj | Adjacency | Adjacency instance (must be a single matrix). | required |
Returns:
| Type | Description |
|---|---|
| networkx.Graph or networkx.DiGraph: Graph representation of the adjacency matrix. Uses DiGraph for directed matrices. |
write¶
write(adj, file_name, method = 'long')Write out Adjacency object to csv file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adj | Adjacency object to write | required | |
file_name | str | name of file name to write | required |
method | str | method to write out data [‘long’,‘square’] | ‘long’ |