title: Create origin-Destination matrix from a Data Frame in Python
body: <p>I would like to create an origin-destination matrix from the following data frame in python: </p>
  
  <pre><code>Origin  Destination
  1         2
  1         3
  1         4
  2         3
  3         4
  </code></pre>
  
  <p>I expect the following matrix:</p>
  
  <pre><code>   1  2  3  4
  1  0  1  1  1
  2  0  0  1  0 
  3  0  0  0  1
  4  0  0  0  0
  </code></pre>
  
  <p>I know that it could be done in R using table() function, but I don't know how to do it in python. Many thanks for any help. </p>