communities icon indicating copy to clipboard operation
communities copied to clipboard

AttributeError: module 'networkx' has no attribute 'from_numpy_matrix'

Open RylanSchaeffer opened this issue 1 year ago • 0 comments

The given example:

    communities, frames = louvain_method(adj_matrix=adj_matrix)
    ax = draw_communities(adj_matrix, communities)

throws an error: AttributeError: module 'networkx' has no attribute 'from_numpy_matrix'. According to https://stackoverflow.com/a/75284568, it seems like this line is now no longer valid:

https://github.com/shobrook/communities/blob/master/communities/visualization/draw_communities.py#L188

Can you please update the library to use G = nx.from_numpy_array(adj_matrix) instead?

RylanSchaeffer avatar Oct 09 '23 18:10 RylanSchaeffer