title: How to make a copy of a 2D array in Python?
body: <p><code>X</code> is a 2D array. I want to have a new variable <code>Y</code> that which has the same value as the array <code>X</code>. Moreover, <strong>any further manipulations with Y should not influence the value of the X.</strong> </p>
  
  <p>It seems to me so natural to use <code>y = x</code>. But it does not work with arrays. If I do it this way and then changes y, the x will be changed too. I found out that the problem can be solved like that: <code>y = x[:]</code></p>
  
  <p>But it does not work with 2D array. For example:</p>
  
  <pre><code>x = [[1,2],[3,4]]
  y = x[:]
  y[0][0]= 1000
  print x
  </code></pre>
  
  <p>returns <code>[ [1000, 2], [3, 4] ]</code>. It also does not help if I replace <code>y=x[:]</code> by <code>y = x[:][:]</code>.</p>
  
  <p>Does anybody know what is a proper and simple way to do it?</p>