Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df = pd.DataFrame({ "id":[1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,4,4],
- "date":("2000-07-06","2000-07-07","2000-07-08","2000-07-09","2000-07-10","2000-07-06","2000-07-10","2000-07-11","2000-07-17","2000-07-20","2000-07-06","2000-07-07","2000-07-08","2000-07-10","2000-07-15","2000-07-16","2000-07-25","2000-07-11","2000-07-20")})
- df.date =pd.to_datetime(df.date)
- date id
- 1 2000-07-06 1
- 2 2000-07-07 1
- 3 2000-07-08 1
- 4 2000-07-09 1
- 5 2000-07-10 1
- 6 2000-07-06 2
- 7 2000-07-10 2
- 8 2000-07-11 2
- 9 2000-07-17 2
- 10 2000-07-20 2
- 11 2000-07-06 3
- 12 2000-07-07 3
- 13 2000-07-08 3
- 14 2000-07-10 3
- 15 2000-07-15 3
- 16 2000-07-16 3
- 17 2000-07-25 3
- 18 2000-07-11 4
- 19 2000-07-20 4
- count id
- 1 4 1
- 2 1 2
- 3 3 3
- 3 0 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement