2

A beginner in this area here.

I am looking to to make a function which takes input as a graph and returns an array with degree of all nodes like

[1 2 3 4 5 2]

corresponding to 1st node having a degree of 1..?

I have made a function that returns a graph. Now I want to use this graph and return an array.

Is there a way to convert a graph with a built in function? I tried numpy_to_matrix but that doesn't work.

3
  • networkx.degree(graph) or graph.degree (IIRC) Nov 11, 2018 at 13:24
  • Thanks. What does IIRC stand for?
    – NewYork
    Nov 12, 2018 at 0:30
  • If I recall correctly Nov 12, 2018 at 13:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.