Session Ready
Exercise

Make edgelist

Now, you're going to apply the same ideas to making an edge list. Go forth and give it a shot!

As with the previous exercise, run G.edges(data=True)[0] in the IPython Shell to get a feel for the edge list data structure before proceeding.

Instructions
100 XP
  • Initialize a list called edgelist to store each edge as a record.
  • Use a for loop to iterate over the edges of G_people. Inside the loop:
    • Initialize a dictionary called edgeinfo that shows edge information.
    • Update the edgeinfo dictionary with the metadata dictionary d.
    • Append the edgeinfo dictionary to edgelist.
  • Create a pandas DataFrame of the edgelist called edge_df.