title: Crossover two NumPy arrays efficiently
body: <p>I want to crossover (swap tails at index 'x') two NumPy arrays with the least computational and memory effort.
  Currently I do it as follows:</p>
  
  <pre><code>import numpy as np
  a1 = np.zeros(10)
  a2 = np.ones(10)
  x = np.random.randint(1, a1.size)
  a1[:x], a2[:x] = a2[:x].copy(), a1[:x].copy()
  </code></pre>
  
  <p>Is there any way to avoid the copy statement, no matter whether crossover is done in-place? Thank you!</p>