How to decrement an entire csv column with Python - what am I doing wrong?
Question: I am very new to programming so please be patient with me.

I am reading from a .csv like so:

    
    
    1, -2
    2, 3
    3, -6
    4, 5
    5, 7
    

and so on. My goal here, essentially is just to delete the first row, and then
decrement the remaining first column by 1, so I'd have something like..

    
    
    1, 3
    2, -6
    3, 5
    4, 7
    5, *some randomly generated number*
    

Here is what I have so far:

    
    
    del data[0] 
    
    for i in range(len(data)):
    
      newTime = data[i][0] - 1
      oldNum = data[0][1]
      data.insert(i, [newTime, oldNum])
    

however this is just taking 1, 3 and inserting it len(data) times.. what am I
doing wrong? Please don't be mean, I really am trying to learn!

I was using this as guidance:
<http://docs.python.org/release/1.5.1p1/tut/range.html>, and to me it seems
like this should work.. :/ Haaaalp!


Answer: 
    import random
    
    data = [[1,2], 
            [2,4], 
            [3,-5], 
            [4,9], 
            [5,7]]
    
    l = len(data)
    
    for i in range(l-1):
        data[i][1] = data[i+1][1]
    
    data[l-1][1] = random.randint(-3,3)
    
    print(data)
    

output:

    
    
    [[1, 4], 
    [2, -5], 
    [3, 9], 
    [4, 7], 
    [5, 0]]
    

