I have the following dataset :
SessionNo ItemNo  TransactType
1           12        0
1           13        1    
1           12        1
2           15        0
...
I want to generate a new attribute Time according to
the SessionNo attribute. The new dataset looks like that : 
SessionNo  Time  ItemNo  TransactType
    1        1    12        0
    1        2    13        1    
    1        3    12        1
    2        1    15        0
   ...
Is there a simple way to perform this task in Python?