Read/Write/Load¶
Functions to read, write and load dynamic graphs.
Simple example¶
import tnetwork as tn
sn = tn.read_snapshots("file_to_Read")
tn.write_snapshots(sn,"file_to_write")
Load example graphs¶
A few dynamic graphs are already included in the library and can be loaded in one command in the chosen format
graph_socioPatterns2012([format]) |
Function that return the graph of interactions between students in 2012, from the SocioPatterns project. |
graph_socioPatterns_Hospital([format]) |
Function that return the graph of interactions in the hospital of Lyon between patients and medical staff, from the SocioPatterns project. |
graph_socioPatterns_Primary_School([format]) |
Function that return the graph of interactions between children and teachers, from the SocioPatterns project. |
graph_GOT() |
Return Game of Thrones temporal network |
Read/Write graphs¶
Read/Write Generic¶
read_interactions(file[, frequency, format, …]) |
Read link stream data |
from_pandas_interaction_list(interactions, …) |
Read/Write snapshot graphs¶
read_interactions(file[, frequency, format, …]) |
Read link stream data |
read_snapshots(inputDir[, format, …]) |
Read as one file per snapshot |
write_snapshots(dynGraph, outputDir, format) |
Write one file per snapshot |
Read/Write interval graphs¶
read_interactions(file[, frequency, format, …]) |
Read link stream data |
read_period_lists(file_address) |
Read as list of periods |
write_as_IG(graph, filename) |
Write a corresponding json file |
write_period_lists(theDynGraph, fileOutput) |
Write as list of periods |
write_ordered_changes(dynNet, fileOutput[, …]) |
Write as list of successive changes |
Read/Write Link Streams¶
read_interactions(file[, frequency, format, …]) |
Read link stream data | ||
read_LS(filename) |
Read TS json format | ||
write_as_LS(graph, filename) |
|
Read/Write Communities¶
Read/Write snapshot snapshot_affiliations¶
write_com_SN(dyn_communities, output_dir[, …]) |
Write directory, 1 file = snapshot_affiliations of a snaphshot |
read_SN_by_com(inputDir[, sn_id_transformer]) |
Read directory, 1 file = snapshot_affiliations of a snaphshot |