I write this code to generate scale free network with power law degree distribution.
import networkx as nx
import random
N = 1000
exponent = 2.2
test = [int(random.paretovariate(exponent-1)) for i in range(N)]
graph = nx.configuration_model(test)
print("number of self-loops : ", graph.number_of_selfloops())
but I face this error:
AttributeError: 'MultiGraph' object has no attribute 'number_of_selfloops'
I can't understand what is the problem and how can I fix it. Is there any other ways to generate such network with networkX? (I don't want self-loops and multi-links to be removed)