grakel.graph_from_csv

grakel.graph_from_csv(edge_files, node_files=None, index_type=<class 'str'>, directed=False, sep=', ', as_Graph=False)[source][source]

Produces a collection of Graph Objects from a collection of csv files.

A function for helping a user that has a bunch of graph csv files make a collection for grakel input.

Parameters
edge_filestuple(iter(str), bool, bool or None)

edge_files = (iter(<edge_file_address>), <weight_flag>, <attributes_flag>). Each line of all the edge files must have the following structure:

<v_i><sep><v_j>[weight][labels/attr]

weights: "<sep><weight>", <weight_flag> is True
         "", <weight_flag> is False
labels/attr: "<sep><label>", <attributes_flag> is False
             "<sep><a_1>, .. , <sep><a_n>", <attributes_flag> is True
             "", <attributes_flag> is None
node_filestuple(iter(str), bool) or None, default=None

node_files = (iter(<node_file_address>), index_type, <attributes_flag>). Each line of the node file must have the following structure (if exists):

<v_i><sep>[labels/attr]

labels/attr: "<sep><label>", <attributes_flag> is False
             "<sep><a_1>, .. , <sep><a_n>", <attributes_flag> is True
             "", <attributes_flag> is None
directedbool, default=False

Defines if the graph should be considered as directed.

sepstr, default=”,”

The separator for the csv files.

as_Graphbool, default=False

Return each output as a grakel.Graph object.

Returns
grakel_graphsgenerator

Returns a generator containing the same collections to be given as an input for any grakel kernel.