title: Python: List is overwritten. But Why?
body: <p>The following code:</p>
  
  <pre><code>file_path = 'some_path/data.txt'
  exp = loadtxt(file_path)
  
  signal_exp = []
  signal_exp.append(exp[1, :])
  
  signal_exp_new = []
  signal_exp_new.append(signal_exp[0])
  
  signal_exp_new[0][0:800] = 0.0
  </code></pre>
  
  <p>will result in <code>signal_exp</code> beeing overwritten at the first 800 elements as well as <code>signal_exp_new</code>. I found the solution but I do not understand why the next one works as expected (of me at least):</p>
  
  <pre><code>file_path = 'some_path/data.txt'
  exp = loadtxt(file_path)
  
  signal_exp = []
  signal_exp.append(exp[0, :].tolist())
  
  signal_exp_new = []
  signal_exp_new.append(signal_exp[0][:])
  
  for l in range(800):
      signal_exp_new[0][l] = 0.0
  </code></pre>
  
  <p>Can anyone give me an explanation why in the latter case, the original list is not overwritten but in the first case it is?</p>