title: Howto make numpy ndarray.tobytes() return bytes in python 2.7
body: <p>I have two python versions installed on ubuntu 14.04:</p>
  
  <ul>
  <li>PV1) 2.7.6</li>
  <li>PV2) 3.4</li>
  </ul>
  
  <p>Both installations have numpy at version 1.10.4</p>
  
  <p>When running</p>
  
  <pre><code>arr = np.random.randint(0,255,(3,3))
  type(arr.tobytes())
  </code></pre>
  
  <p>I get <code>str</code> for PV1 and <code>bytes</code> for PV2.</p>
  
  <p>What I need is to get bytes in both installations.
  How can I achieve that without programming, but rather up/downgrading something?</p>
  
  <p>The point is that the <code>.tobytes()</code> call is in some 3rd party module and I would like to avoid modifying this code.</p>
  
  <p>Thanks in advance,</p>
  
  <p>werpoi</p>