
Matt S. answered 05/24/19
For Me, Data Science Is More Of An Art Than A Science
The code that you've posted looks as if it should create a copy (new_list) of an original (old_list). What is happening under the covers is that a new reference has been created that points to the original list. To put it another way, new_list and old_list point to the same object in memory. In order to create a new list that is a separate and distinct object in memory from old_list, try
new_list = old_list.copy() # Python 3 copy() method
# or
new_list = old_list[:] # Python 2 (slice)