title: How to create a diagonal multi-dimensional (ie greater than 2) in numpy
body: <p>Is there a higher (than two) dimensional equivalent of diag?</p>
  
  <pre><code>L = [...] # some arbitrary list.
  A = ndarray.diag(L)
  </code></pre>
  
  <p>will create a diagonal 2-d matrix shape=(len(L), len(L)) with elements of L on the diagonal.</p>
  
  <p>I'd like to do the equivalent of:</p>
  
  <pre><code>length = len(L)
  A = np.zeros((length, length, length))
  for i in range(length):
      A[i][i][i] = L[i]
  </code></pre>
  
  <p>Is there a slick way to do this?</p>
  
  <p>Thanks!</p>