I would like to come up with the 4th column below based on the first three:
user job time Rank
A print 1559 2
A print 1540 2
A edit 1520
Or you can using
df1=df1.sort_values(['user','time'],ascending=[True,True])
df1['Rank']=df1.job!=df1.job.shift().fillna('edit')
df1.Rank=df1.groupby('user').Rank.cumsum()+1
user job time Rank
0 A print 1559 2.0
1 A print 1540 2.0
2 A edit 1520 1.0
3 A edit 1523 1.0
4 A deliver 9717 3.0
5 B edit 1717 2.0
6 B edit 1716 2.0
7 B edit 1715 2.0
8 B deliver 1527 1.0
9 B deliver 1524 1.0