Python Forum
How to use "create_degree_sequence"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use "create_degree_sequence"
#1
Hi,

I am rather new to Python and I have a difficulty to use "networkx.Utils". I want to create a graph by creating a degree sequence. However, I don't succeed to import anything from "networkx.Utils". I have installed networkx and have created graphs that I wanted. But I am not succeeding to use the utils. Here what I have done...

import networkx as nx
from networkx.utils import uniform_sequence
seq=nx.create_degree_sequence(10,uniform_sequence)
So I get the error message "ImportError: cannot import name 'uniform_sequence' from 'networkx.utils'"
Would you please help me with this issue, I would appreciate it.
Reply
#2
always post complete unmodified error traceback, we need that to properly diagnose any problem.
Reply
#3
I noticed that "create_degree_sequence" is deprecated from networkx.Utils. So I succeeded to download the source code and directly use it without the need for importing the package. So the issue is solved. However, I am struggling to create a graph with the given average degree. I don't want a graph with the same degrees but I want graphs with the given average degree and large diameters.
thanks

(May-01-2020, 05:35 PM)Larz60+ Wrote: always post complete unmodified error traceback, we need that to properly diagnose any problem.
Thanks for the feedback, I will do for the future posts. For now the issue is solved but not my problem :)
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020