title: Python example for scipy dia_matrix
body: <p>Running this code</p>
  
  <pre><code>d0  = np.ones(N)
  dp1 = np.ones(N - 1)
  dm1 = np.ones(N - 1)
  
  diag = [[d0],[dp1],[dm1]]
  offsets = [0,1,-1]
  
  A = dia_matrix( (diag,offsets), shape=(N,N), dtype=float)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/dia.py", line 109, in __init__
  self.data = np.atleast_2d(np.array(arg1[0], dtype=dtype, copy=copy))
  </code></pre>
  
  <p>ValueError: setting an array element with a sequence.</p>
  
  <p>I can't understand what I'm doing wrong! Can someone provide me a correct example to do what I'm trying to do?</p>