title: Pandas DataFrame with X,Y coordinates to NumPy matrix
body: <p>I have a DataFrame with columns <code>X</code>, <code>Y</code> and <code>value</code>, e.g.:</p>
  
  <pre><code>   X |   Y | value
  ------------------
     1 |   1 |    56
     2 |   1 |    13
     3 |   1 |    25
   ... | ... |   ...
     1 |   2 |     7
     2 |   2 |    18
   ... | ... |   ...
     1 | 123 |    91
   ... | ... |   ...
    50 | 123 |    32
  </code></pre>
  
  <p>I need to convert this to DataFrame to a NumPy matrix:</p>
  
  <pre><code>[[56, 13, 25, ...],
   [ 7, 18,     ...],
   ...,
   [ 91, ...   , 32]]
  </code></pre>
  
  <p>I know I can iterate over each cell of the DataFrame, but that is too slow. What is the effective way of doing this?</p>
  
  <p>Also note: values for some coordinates in DataFrame are missing</p>