title: How to create an edge list dataframe from a adjacency matrix in Python?
body: <p>I have a pandas dataframe (think of if as a weighted adjacency matrix of nodes in a network) of the form, <strong>df</strong>,</p>
  
  <pre><code>    A    B    C    D
  A   0   0.5   0.5  0 
  B   1    0    0    0
  C   0.8  0    0   0.2
  D   0    0    1    0
  </code></pre>
  
  <p>I want to get a dataframe that instead represents an edge list. for the above example, I would need something of the form, <strong>edge_list_df</strong>,</p>
  
  <pre><code>    Source    Target    Weight    
  0   A           B        0.5 
  1   A           C        0.5
  2   A           D        0
  3   B           A        1
  4   B           C        0
  5   B           D        0
  6   C           A        0.8
  7   C           B        0
  8   C           D        0.2
  9   D           A        0
  10  D           B        0
  11  D           C        1
  </code></pre>
  
  <p>What is the most efficient way to create this?</p>