You aren't copying the list correctly, I think.
Your original list looks something like this:
[[1,2,3],[4,5,6],[7,8,9]]
When you copy it, you create a new list called newA:
[]
and you just add elements to it:
[1,2,3,4,5,6,7,8,9]
so your list format is different.
This is perhaps what you intended:
newA=[]
row=[]
for row in range(0,height):
newRow = []
for col in range(0,width):
if A[row][col]==0:
newRow+=[0]
elif A[row][col]==1:
newRow+=[1]
newA += [newRow]