January 2019
Beginner to intermediate
154 pages
4h 31m
English
The total number of edges connected to a vertex is known as the degree of that vertex. We can use the degrees() method to find out the degree of each vertex of the graph:
#Pythongraph.degrees.show()Out:+---+------+ | id|degree| +---+------+ | 5 | 2 | | 1 | 3 | | 3 | 2 | | 2 | 1 | | 4 | 2 | +---+------+
As shown in the previous example, the output of the degrees() method is a new DataFrame. In our example, there are five edges, which are connected to the vertex with id 1.
Read now
Unlock full access