title: Why is numpy.random.choice modifying my data?
body: <p><strong>Task</strong>: use numpy.random.choice to sample from [0,512] randomly where the numbers are expressed in bytes array.</p>
  
  <p><strong>Problem</strong>: numpy casts 512 to 2.</p>
  
  <p><strong>Code Example</strong>:</p>
  
  <pre><code>import numpy
  a = (512).to_bytes(4, 'big')
  b = (0).to_bytes(4, 'big')
  print(int.from_bytes(numpy.random.choice([a,b]), 'big'))
  </code></pre>
  
  <p><strong>Expected output</strong>: <code>0</code> or <code>512</code></p>
  
  <p><strong>Actual output</strong>: <code>0</code> or <code>2</code></p>
  
  <p>However, if <code>numpy.random.choice</code> is replaced by the built-in <code>random</code>, this will not happen.</p>