2017-10-15 1 views
0

networkx blockmodel 함수를 사용하려하지만 Python은 'blockmodel'속성이 없다는 것을 계속 말합니다. 나는 here 링크의 문서에있는 예제 코드를 사용하고있다.'networkx'모듈에 'blockmodel'속성이 없습니다?

networkx가 설치되어 있고 다른 많은 기능이 작동하고 있습니다. 이 사람 만이 불평하는 것 같습니다. 도움을 많이 주시면 감사하겠습니다.

답변

2

으로 networkx의 최신 버전 (이전 문서를보고 있음)에서 blockmodel 기능이 바뀌 었습니다.
여기

>>> G = nx.path_graph(6) 
>>> partition = [{0, 1}, {2, 3}, {4, 5}] 
>>> M = nx.quotient_graph(G, partition, relabel=True) 
>>> list(M.edges()) 
[(0, 1), (1, 2)] 

업데이트 된 문서화 https://networkx.github.io/documentation/stable/reference/algorithms/generated/networkx.algorithms.minors.quotient_graph.html?highlight=blockmodel 을 참조하십시오 blockmodel 생성 단계의 일례이다.