错误提示如下:

  File "D:\Anaconda\lib\site-packages\networkx\convert_matrix.py", line 594, in to_scipy_sparse_array
    A = sp.sparse.coo_array((d, (r, c)), shape=(nlen, nlen), dtype=dtype)
AttributeError: module 'scipy.sparse' has no attribute 'coo_array'

 原因是scipy.sparse包中没有coo_array函数方法,只需要把coo_array替换成coo_matrix实现即可

在运行networkx构建关系图中出现报错,版本是:

  1. networkx: 3.1
  2. python 3.8
  3. scipy: 1.5.4
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐