title: Array swapping in python
body: <p>I want to swap elements between two array starting from a particular array index value keeping other values prior to the array index intact.    </p>
  
  <pre><code>import numpy as np
  r = np.array([10, 20, 30, 40, 50, 60])
  p = np.array([70, 80, 90, 100, 110, 120])
  
  t = []
  for i in range(len(r)):
      for j in range(len(p)):
          if i &gt;= 3 and j &gt;= 3:
              t.append(p[j])
              p[j] = r[i]
              for k in t:
                  r[i] = k
  </code></pre>
  
  <p>The above code does the task but the values are in reverse order.
  The value that I want in array <code>p</code> after swapping is:</p>
  
  <pre><code>[70, 80, 90, 40, 50, 60]
  </code></pre>
  
  <p>and the value that i want in array r after swapping is:</p>
  
  <pre><code>[10, 20, 30, 100, 110, 120]
  </code></pre>
  
  <p>But in array <code>p</code> I am getting:</p>
  
  <pre><code>[70, 80, 90, 60, 50, 40]
  </code></pre>
  
  <p>and in array <code>r</code> I am getting:</p>
  
  <pre><code>[10, 20, 30, 120, 110, 100]
  </code></pre>
  
  <p>I don't know what is wrong with the code.</p>