This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# 3. Get Data # | |
############################################################################### | |
json_file = "Location History.json" | |
data = json.load(open(json_file)) # Read the file | |
locations = data['locations'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# 2. User Inputs # | |
############################################################################### | |
start_year, start_month, start_day = 2021, 6, 30 | |
end_year, end_month, end_day = 2021, 7, 25 | |
point_of_interest = (-77.85, 166.64) # Latitude, Longitude | |
distance_from_point_of_interest = 0.1 | |
aggregate_by = 'Day' # This can be 'Year', 'Month', 'Day', 'Hour', 'Second' | |
weekday_exceptions = ['Saturday','Sunday'] # A list of weekdays that should excluded. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# 1. Importing Libraries # | |
############################################################################### | |
import json | |
import datetime | |
import pandas as pd | |
from geopy import distance |
NewerOlder