graph.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:ndmg 作者: neurodata 项目源码 文件源码
def save_graph(self, graphname, fmt='gpickle'):
        """
        Saves the graph to disk

        **Positional Arguments:**

                graphname:
                    - Filename for the graph

        **Optional Arguments:**

                fmt:
                    - Output graph format
        """
        self.g.graph['ecount'] = nx.number_of_edges(self.g)
        if fmt == 'gpickle':
            nx.write_gpickle(self.g, graphname)
        elif fmt == 'graphml':
            nx.write_graphml(self.g, graphname)
        else:
            raise ValueError('graphml is the only format currently supported')
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号