I have a list of lists e.g `[[0, 0], [4, 0], [2, 0], [5, 3], [0, 1]]`

My desired output is `[[0, 0], [1, 0], [2, 0], [3, 4], [0, 5]]`

That is, I wish to modify the list such that if the value is not zero, I set it to the count, which starts at 1 and increments by 1 for each non-zero value. If it's 0, I keep it as 0. 

How do I go about this? I started by indexing using `enumerate` but it's harder than I thought.

Here is what I have done: `w` generates the initial list. This is not my full code because it is too long to post.

```
w = [[i if i != l else 0 for i in x] for x in c]
print(w)
inc = 1
lx = []
gg = []
for i in w:
   if i[0] or i[1] !=0:
      g = w.index(i)
      gg.append(g)
      lx.append(i)
for x in gg:
   for i, v in enumerate(w):
       if x==i:
          if
          print(x, i, v)

```

Thank you