1

I am creating a directed network diagram and want to create a data frame which has one row for each link. How can I build it from a data frame that only has two columns with the source and the destinations?

I have a From column, which is the source and To column which involves lists of each destination.

# What I have:
From            To
A               [B,C,D]
B               [C,D]
C               [A]

# What I need:
Source          Destination
A               B
A               C
A               D
B               C
B               D
C               A
realkes
  • 833
  • 1
  • 12
  • 20
  • Possible duplicate of: https://stackoverflow.com/questions/27263805/pandas-when-cell-contents-are-lists-create-a-row-for-each-element-in-the-list – Charles Landau Jan 14 '19 at 16:10

0 Answers0