title: Create permutation matrix - numpy
body: <p>Given an integer <code>k</code> how would I create a permutation matrix with all possible permutations of the sequence <code>1</code> to <code>k</code>? For example, let's consider <code>k=2</code>. Then I would like to create the matrix:</p>
  
  <pre><code>1 2
  2 1
  </code></pre>
  
  <p>and for <code>k=3</code>:</p>
  
  <pre><code>1 1 2 2 3 3
  2 3 1 3 1 2 
  3 2 3 1 2 1
  </code></pre>
  
  <p>I've tried using <code>numpy.random.permutation</code> but this only produces a single permutation. So, I could continue using this function, appending unique permutations until the number of columns is equal to <code>k!</code> but this seems incredibly inefficient.</p>