AddNodesAttributes
AddNodesAttributes(in_graph, in_dataset, id_column, labels, out_file=‘graph_with_attributes.gexf’, verbose=False, overwrite=False)
Setting Nodes Attributes
AddNodesAttributes is a script that sets the attributes of the nodes of a graph. The attributes are provided via a tabulated data format (.csv, .xlsx or .txt) file. The script will automatically match the IDs of the nodes with the IDs of the subjects in the file. Name of the variables to add as attributes can be supplied either via a .txt file or with multiple –labels arguments.
Example Usage
Parameters
in_graph : Graph file to add attributes to.
in_dataset : Dataset containing the variables to add as nodes’ attributes to the graph.
id_column : Name of the column containing the subject’s ID tag. Required for proper handling of IDs and merging multiple datasets.
labels : Label(s) name(s) to add as nodes’ attributes to the graph. Can be supplied multiple times or as a .txt file containing all names in a line separated format.
out_file : Output graph file name (.gml).
verbose : If true, produce verbose output.
overwrite : If true, force overwriting of existing output files.