How it works...

As noted in the previous section, when creating a GraphFrame, it specifically looks for the following columns:

  • id: This identifies the vertex and will join to the src and dst columns. In our example, the IATA code LAX (representing Los Angeles Airport) is one of many airports that make up the vertices in our graph (graph).
  • src: The source vertex of our graph's edges; for example, a flight from Los Angeles to New York has src = LAX.
  • dst: The destination vertex of our graph's edges; for example, a flight from Los Angeles to New York has dst = JFK.

By creating the two DataFrames (vertices and edges) where the attributes follow the previously noted naming convention, we can invoke the GraphFrame to create our graph, utilizing the performance optimizations of the two DataFrames underneath.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset