1
import networkx as nx
G = nx.read_edgelist('webpages.txt', create_using=nx.DiGraph())
print(nx.info(G))
AttributeError: module 'networkx' has no attribute 'info'

print(nx.info(G)) without the error

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Mar 31 '23 at 20:23

2 Answers2

1

You can also just print(G) to get the graph properties

Tom G.
  • 376
  • 2
  • 6
0

info method has been removed from networkx 3

You should consider accessing the Graph properties directly instead

print('Number of nodes', len(G.nodes))
print('Number of edges', len(G.edges))
print('Average degree', sum(dict(G.degree).values()) / len(G.nodes))
tax evader
  • 2,082
  • 1
  • 7
  • 9