I have two lists
x=[0.0, -0.9000000000000199, 2.1499999999999773, 1.799999999999983, -1.5000000000000284, -2.3500000000000227, -3.05000000000004, 2.0999999999999943, 3.9999999999999716, 1.8499999999999943, -4.650000000000006, 11.349999999999994]
y=[-5.750000000000028, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
I use below logic to remove zero completely. But zeroes of y are not completely removed.
for i in x:
if i==0:
x.remove(i)
for j in y:
if j==0:
y.remove(j)
print(x)
print(y)
I get the output as follows, ie I still have zero in my y list.
[-0.9000000000000199, 2.1499999999999773, 1.799999999999983, -1.5000000000000284, -2.3500000000000227, -3.05000000000004, 2.0999999999999943, 3.9999999999999716, 1.8499999999999943, -4.650000000000006, 11.349999999999994]
[-5.750000000000028, 0.0, 0.0, 0.0, 0.0, 0.0]