Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # Change this with whatever function you want for grouping
- def grouping(line):
- return int(line) // (24 * 3600 * 1000)
- histo = {}
- with open('some_file.csv', 'r') as file:
- for line in file.readlines():
- key = grouping(line)
- histo[key] = histo.get(key, 0) + 1
- for k, v in histo.items():
- print('{},{}'.format(k,v))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement