this is the code i am trying to create the 2d matrix
m=4
tagProb=[[]]*(m+1)
count=0
index=0
for line in lines:
print(line)
if(count < m+1):
tagProb[index].append(line.split('@@')[2].strip())
count+=1
if(count == m+1): // this check to goto next index
count = 0
index+=1
print(tagProb)
i get the o/p
[['0.0', '0.6', '0.05', '0.3', '0.05', '0.1', '0.0', '0.6', '0.0', '0.0', '0.1', '0.0', '0.0', '0.9', '0.0', '0.1', '0.0', '0.2', '0.7', '0.0', '0.1', '0.0', '0.9', '0.0', 0.0'], ['0.0', '0.6', '0.05', '0.3', '0.05', '0.1', '0.0', '0.6', '0.0', '0.0', '0.1', '0.0', .0', '0.9', '0.0', '0.1', '0.0', '0.2', '0.7', '0.0', '0.1', '0.0', '0.9', '0.0', '0.0'], '0.0', '0.6', '0.05', '0.3', '0.05', '0.1', '0.0', '0.6', '0.0', '0.0', '0.1', '0.0', '0.0','0.9', '0.0', '0.1', '0.0', '0.2', '0.7', '0.0', '0.1', '0.0', '0.9', '0.0', '0.0'] ]
all the values are appended and list has same values. How can i avoid this ?