Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

io

io

I/O functions for Adjacency objects.

Methods:

NameDescription
to_graphConvert Adjacency into networkx graph.
writeWrite 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:

NameTypeDescriptionDefault
adjAdjacencyAdjacency instance (must be a single matrix).required

Returns:

TypeDescription
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:

NameTypeDescriptionDefault
adjAdjacency object to writerequired
file_namestrname of file name to writerequired
methodstrmethod to write out data [‘long’,‘square’]‘long’