January 2019
Beginner to intermediate
154 pages
4h 31m
English
Unlike GraphX, GraphFrames does not provide any direct method to create subgraphs, but you can create subgraphs just by writing some filter conditions on either vertices or edges. The following example shows how to filter out all the edges that have a relation property other than "friend":
#Python#filter out edges with relation other than "friend"friendsGraph = GraphFrame(graph.vertices, graph.edges.filter("attr == 'friend'"))
In the previous example, we will only get those edges that have a relation of "friend". The friendsGraph will preserve all the vertices of the original graph.
Read now
Unlock full access