cdlib.readwrite.read_community_json¶
-
read_community_json
(path, zip=False)¶ Read community list from JSON file.
Parameters: - path – input filename
- zip – wheter the file is in a copress format, default False
Returns: a Clustering 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") >>> readwrite.read_community_json(coms, "communities.json")