title: merge to subarray based on their original indices
body: <p>I split this array:</p>
  
  <pre><code>import numpy as np
  
  a=np.array([7,1,2,3,4,5,0])
  </code></pre>
  
  <p>into</p>
  
  <pre><code>b=a[a&lt;=2]
  c=a[a&gt;2]
  </code></pre>
  
  <p>or</p>
  
  <pre><code>b=[1,2,0]
  c=[7,3,4,5]
  </code></pre>
  
  <p>Then, I predict b and c:</p>
  
  <pre><code>pred_b=[.9,2.01,.02]
  pred_c=[7,3,3.85,5.001]
  </code></pre>
  
  <p>I would appreciate if you could let me know how to get this:</p>
  
  <pre><code>d=[7,.9,2.01,3,3.85,5.001,.02]
  </code></pre>