cdlib.readwrite.read_community_csv

read_community_csv(path, delimiter=', ', nodetype=<class 'str'>)

Read community list from comma separated value (csv) file.

Parameters:
  • path – input filename
  • delimiter – column delimiter
  • nodetype – specify the type of node labels, default str
Returns:

NodeClustering object

Example:
>>> import networkx as nx
>>> from cdlib import algorithms, readwrite
>>> g = nx.karate_club_graph()
>>> coms = algorithms.louvain(g)
>>> readwrite.write_community_csv(coms, "communities.csv", ",")
>>> coms = readwrite.read_community_csv(coms, "communities.csv", ",", str)