zzzbbx
zzzbbx

Reputation: 10131

error when using random graph generator in NetworkX

I am trying to create a graph F with a degree sequence of another graph G. The code is this

import networkx as nx
import matplotlib.pyplot as plt


# some code 
    deg_sequence = nx.degree(G).values()   
    print nx.is_valid_degree_sequence(deg_sequence)
    F = nx.random_degree_sequence_graph(deg_sequence, seed=None, tries=10)

but I get this error

True
AttributeError: 'module' object has no attribute 'random_degree_sequence_graph'

I just updated Networkx. Am I doing something wrong?

Upvotes: 0

Views: 843

Answers (1)

rechardchen
rechardchen

Reputation: 184

I searched the documentation for nx.random_degree_sequence_graph, and it is a new function in version1.6 .

try:

easy_install networkx==1.6

:)

Upvotes: 1

Related Questions