Exporting to Pandas dataframes
Raphtory enables a powerful table → graph → table workflow: ingest data from DataFrames, apply graph algorithms and temporal operations, then export the results back to DataFrames for downstream ML pipelines and data tools.
This makes Raphtory a natural extension of your existing data science workflow. Use to_df() on Nodes and Edges to convert your graph data back into tabular format.
Node Dataframe
To explore the use of to_df() on the nodes we first call the function with default parameters. This exports only the latest property updates and utilises epoch timestamps - the output from this can be seen below.
To demonstrate flags, we call to_df() again, this time enabling include_property_history and convert_datetime. The output for this can also be seen below.
Edge Dataframe
Exporting to an edge dataframe via to_df() generally works the same as for the nodes. However, by default this will export the property history for each edge, split by edge layer. This is because to_df() has an alternative explode flag to view each update individually (which will then ignore include_property_history).
In the below example we first create a subgraph of the monkey interactions, selecting ANGELE and FELIPE as the monkeys we are interested in. This isn't a required step, but helps to demonstrate the export of GraphViews.
Then we call to_df() on the subgraph edges, setting no flags. In the output you can see the property history for each interaction type (layer) between ANGELE and FELIPE.
Finally, we call to_df() again, turning off the property history and exploding the edges. In the output you can see each interaction that occurred between ANGELE and FELIPE.
We have further reduced the graph to only one layer via layers() to reduce the output size.