I have a nested list, which I make a new copy of (IDs are different). Then when I try to use indices to update a list within the new list, it ends up updating the values in both the pre and post copied lists.
I took a look at some other similar questions that talk about mutability but I'm not 100% sure I understand how it works in my specific case.
Heres some example code:
numTrials = 2
abPositions = [[1, 'a.png', [9, 9, 9, 9]], [1, 'b.png', [9, 9, 9, 9]]]
abPositionsRotated = list(abPositions)
for i in xrange(numTrials):
abPositionsRotated[i][2] = [0,0,0,0]
print abPositions
print abPositionsRotated
so as I update the 2 sublists within abPositionsRotated, the same lists get updated in abPositions as well and I'm not sure why. As far as I know, there is no link between the abPositions and abPositionsRotated, so I dont understand why changes to one affects the other