File size: 316 Bytes
be89e03 | 1 2 3 4 5 6 7 8 9 10 11 12 | import pickle
import pandas as pd
with open("graph_database.pkl", "rb") as f:
G = pickle.load(f)
# Convert edges to a list of dictionaries
edge_list = [{"Subject": s, "Relation": d['label'], "Object": t} for s, t, d in G.edges(data=True)]
# Display as a table
df = pd.DataFrame(edge_list)
print(df) |