cdlib.readwrite.write_community_json¶
-
write_community_json
(communities, path)¶ Generate a JSON representation of the clustering object
Parameters: - communities – a cdlib clustering object
- path – output filename
Returns: a JSON formatted string representing the object
Example: >>> import networkx as nx >>> from cdlib import algorithms, readwrite >>> g = nx.karate_club_graph() >>> coms = algorithms.louvain(g) >>> readwrite.write_community_json(coms, "communities.json")