简体   繁体   English

模块'networkx'没有属性'blockmodel'?

[英]Module 'networkx' has no attribute 'blockmodel'?

I'm trying to use the networkx blockmodel function, but Python keeps saying there is no attribute 'blockmodel'. 我正在尝试使用networkx blockmodel函数,但Python一直说没有属性'blockmodel'。 I am using the example code in the documentation in the link here . 我在这里的链接文档中使用示例代码。

I do have networkx installed, and many other functions are working. 我确实安装了networkx,还有很多其他功能正在运行。 Only this one seems to complain. 只有这一个似乎抱怨。 Help is much appreciated. 非常感谢帮助。

The blockmodel function has been replaced in the latest version of networkx (you are looking at older documentation) with quotient_graph . blockmodel函数已在最新版本的networkx(您正在查看较旧的文档)中使用quotient_graph替换。
Here is an example of generating a 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)]

See https://networkx.github.io/documentation/stable/reference/algorithms/generated/networkx.algorithms.minors.quotient_graph.html?highlight=blockmodel for the updated documentation. 有关更新的文档,请参阅https://networkx.github.io/documentation/stable/reference/algorithms/generated/networkx.algorithms.minors.quotient_graph.html?highlight=blockmodel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError:模块“networkx”没有属性“utils” - AttributeError: module 'networkx' has no attribute 'utils' AttributeError: 模块“networkx”没有属性“Graph” - AttributeError: module 'networkx' has no attribute 'Graph' AttributeError:模块“ networkx”没有属性“ complete_graph” - AttributeError: module 'networkx' has no attribute 'complete_graph' AttributeError:'module'对象没有networkx库的属性'write_dot' - AttributeError: 'module' object has no attribute 'write_dot' for networkx library 'Graph'对象在networkx模块python中没有属性'nodes_iter' - 'Graph' object has no attribute 'nodes_iter' in networkx module python AttributeError:模块“networkx”没有属性“connected_component_subgraphs” - AttributeError: module 'networkx' has no attribute 'connected_component_subgraphs' AttributeError:模块“matplotlib.cbook”在 Networkx 中没有属性“is_numlike” - AttributeError: module 'matplotlib.cbook' has no attribute 'is_numlike' in Networkx 模块“ networkx”没有属性“ add_nodes_from” - module 'networkx' has no attribute 'add_nodes_from' AttributeError:'module'对象没有networkx 1.11属性'graphviz_layout' - AttributeError: 'module' object has no attribute 'graphviz_layout' with networkx 1.11 模块 .networkx' 没有属性 'from_pandas_edgelist' - module 'networkx' has no attribute 'from_pandas_edgelist'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM