1

I checked multiple sources but couldn't pinpoint this particular problem although it probably has a very easy fix.

Let's say I have some graph, g.

I am able to print the vertices using g.vertices.show()

But I'm having a lot of trouble figuring out how to load all the vertices into a dataframe of some sort. I want to do a variety of tasks that are well supported on Pandas. Does anyone have a way to do this?

Jonathan
  • 1,876
  • 2
  • 20
  • 56
  • Isn't `g.vertices` a dataframe? What am I missing? – mazaneicha Jul 10 '20 at 00:03
  • doing `g.vertices` gives me a dataframe showing just the columns. It doesn't actually print the data inside the dataframe. It seems stupidly straightforward but for some reason it isn't intuitive. It's hard to actually look inside the dataframe. – Jonathan Jul 10 '20 at 15:41

1 Answers1

0

Just like how .show() will display the results of any query, you can do .toPandas() which will convert the output to a pandas DataFrame. As far as I can tell, this command couples any command that you can couple .show() with.

So for my specific question:

g.vertices.toPandas() solves the problem.

Jonathan
  • 1,876
  • 2
  • 20
  • 56