title: numpy/scipy build adjacency matrix from weighted edgelist
body: <p>I'm reading a weighted egdelist / numpy array like:</p>
  
  <pre><code>0 1 1
  0 2 1
  1 2 1
  1 0 1
  2 1 4
  </code></pre>
  
  <p>where the columns are 'User1','User2','Weight'. I'd like to perform a DFS algorithm with <code>scipy.sparse.csgraph.depth_first_tree</code>, which requires a N x N matrix as input. How can I convert the previous list into a square matrix as:</p>
  
  <pre><code>0 1 1
  1 0 1
  0 4 0
  </code></pre>
  
  <p>within numpy or scipy?</p>
  
  <p>Thanks for your help.</p>
  
  <p>EDIT:</p>
  
  <p>I've been working with a huge (150 million nodes) network, so I'm looking for a memory efficient way to do that.</p>