1
votes

I have created a graph using python-igraph (using python 3.4) and I am trying to access a specific node outdegree using the following line of code:

graph.vertex(i).out_degree()

I have found this code on stackoverflow and I was hoping that this is going to work but I keep receiving an error:

AttributeError: 'Graph' object has no attribute 'vertex'

I would really appreciate your help.

Thanks

1

1 Answers

2
votes

Not that you are using python 3.4, so probably you need to use the following:

graph.vs[i].outdegree()

And that's how you access node i from your graph. I also mentioned the new method to get the outdegree.