title: Random diagonal matrix
body: <p>I want to create a random diagonal matrix with size n such that each element in the diagonal entries has 50% chance of being -1 and 50% chance of being 1. Is there any advice for this?</p>
  
  <pre><code>import numpy as np
  diagonal_entries = np.random.randint(low = -1, high = 1, size = n)
  D = np.diag(diagonal_entries)
  </code></pre>
  
  <p>However, the problem is that `np.random.randint includes 0 as the value too. I only want -1 and 1, excluding 0.</p>