Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Timestamp Status
  2. 1501 Normal
  3. 1501 Normal
  4. 1502 Delay
  5. 1503 Received
  6. 1504 Normal
  7. 1504 Delay
  8. 1505 Received
  9. 1506 Received
  10. 1507 Delay
  11. 1507 Received
  12.  
  13. Timestamp Status Notif
  14. 1501 Normal N0
  15. 1501 Normal N0
  16. 1502 Delay N0
  17. 1503 Received N1
  18. 1504 Normal N1
  19. 1504 Delay N1
  20. 1505 Received N2
  21. 1506 Received N3
  22. 1507 Delay N3
  23. 1507 Received N4
  24.  
  25. Timestamp Status Notif
  26. 1501 Normal N0
  27. 1501 Normal
  28. 1502 Delay
  29. 1503 Received N1
  30. 1504 Normal
  31. 1504 Delay
  32. 1505 Received N2
  33. 1506 Received N3
  34. 1507 Delay
  35. 1507 Received N4
  36.  
  37. df['Notif'] = None
  38. counter = 0
  39. for idx, row in df.iterrows():
  40. if df.iloc[idx, 1] == "Received":
  41. counter +=1
  42. df.iloc[idx,-1] = "N" + str(counter)
  43.  
  44. df.drop_duplicates(subset='Notif', keep="first")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement