Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file_name = ["20180601.csv"]
- raw_data = []
- for f in file_name:
- fin = open(f, "r")
- while True:
- line = fin.readline()[:-1]
- if not line: break
- lines = line.split(',')
- # userID / time / longitude / latitude / locationID
- user = lines[0]
- # Get minute from times
- times = lines[1]
- minute = times.split(':')[1]
- # Processing location to index
- longitude = lines[2]
- latitude = lines[3]
- location = lines[4]
- raw_data.append((minute, (user, times, longitude, latitude, location)))
- check = []
- for rd in raw_data:
- if rd[0] not in check:
- print(rd[1])
- check.append(rd[0])
Add Comment
Please, Sign In to add comment