title: Expand numpy matrix
body: <p>I am trying to somehow expand numpy matrices, which typically look like:</p>
  
  <pre><code>import numpy as np
  
  mtx = np.matrix([[['a','b','c'], ['x'], 3], [['d','e','f'], ['y'], 2],
      [['g','h','i'], ['z'], 1]])
  mtx
  # matrix([[['a', 'b', 'c'], ['x'], 3],
  #         [['d', 'e', 'f'], ['y'], 2],
  #         [['g', 'h', 'i'], ['z'], 1]], dtype=object)
  </code></pre>
  
  <p>The last column contains number of instances of the resulting matrix, which then should look like this:</p>
  
  <pre><code># matrix([[['a', 'b', 'c'], ['x']],
  #         [['a', 'b', 'c'], ['x']],
  #         [['a', 'b', 'c'], ['x']],
  #         [['d', 'e', 'f'], ['y']],
  #         [['d', 'e', 'f'], ['y']],
  #         [['g', 'h', 'i'], ['z']]], dtype=object)
  </code></pre>
  
  <p>So, three times 1st row, two times 2nd etc.</p>
  
  <p>I wonder what would be the fastest and/or the most elegant python-way?</p>
  
  <p>Many tnx! PM</p>