In [1]:
import emission.storage.decorations.location_queries as lq
In [2]:
reload(lq)
Out[2]:
<module 'emission.storage.decorations.location_queries' from '/Users/shankari/e-mission/e-mission-server/emission/storage/decorations/location_queries.pyc'>
In [3]:
%matplotlib inline
In [4]:
lq.get_uuid_list()
Out[4]:
[UUID('0763de67-f61e-3f5d-90e7-518e69793954'),
UUID('f955cff1-8fb8-3b42-8776-6d8874e5b90a'),
UUID('b0d937d0-70ef-305e-9563-440369012b39')]
In [5]:
import datetime as pydt
In [6]:
import pytz
In [7]:
get_jul_dt = lambda date: pydt.datetime(2015,7,date,tzinfo=pytz.timezone("America/Los_Angeles"))
In [8]:
get_aug_dt = lambda date: pydt.datetime(2015,8,date,tzinfo=pytz.timezone("America/Los_Angeles"))
In [9]:
import emission.analysis.plotting.leaflet_osm.our_plotter as lo
In [10]:
reload(lo)
Out[10]:
<module 'emission.analysis.plotting.leaflet_osm.our_plotter' from '/Users/shankari/e-mission/e-mission-server/emission/analysis/plotting/leaflet_osm/our_plotter.pyc'>
In [11]:
df = lq.get_plottable_df(lq.get_uuid_list()[0], "time", get_jul_dt(29), get_jul_dt(30))
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1438156800000.0}}, {'data.mTime': {'$lt': 1438243200000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
In [12]:
df.shape
Out[12]:
(205, 28)
In [13]:
df.mAccuracy.hist(bins=20)
Out[13]:
<matplotlib.axes.AxesSubplot at 0x109b56890>
In [14]:
df.mAccuracy.quantile(0.97)
Out[14]:
140.5904799999999
In [15]:
import numpy as np
In [16]:
np.count_nonzero(df.mAccuracy > 100)
Out[16]:
12
In [17]:
np.count_nonzero(df.mAccuracy > 200)
Out[17]:
6
In [18]:
df[df.mAccuracy > 200]
Out[18]:
filter
key
mAccuracy
mAltitude
mBearing
mDistance
mElapsedRealtimeNanos
mHasAccuracy
mHasAltitude
mHasBearing
...
mLongitude
mProvider
mResults
mSpeed
mTime
platform
read_ts
type
write_ts
formatted_time
60
time
background/location
453.212
0
0
0
338915173000000
True
False
False
...
-122.076251
fused
[0, 0]
0
1438190005779
android
0
message
1438190006628
2015-07-29 10:13:25
65
time
background/location
417.357
0
0
0
339063466000000
True
False
False
...
-122.094375
fused
[0, 0]
0
1438190154072
android
0
message
1438190157622
2015-07-29 10:15:54
75
time
background/location
428.671
0
0
0
339363946000000
True
False
False
...
-122.136062
fused
[0, 0]
0
1438190454552
android
0
message
1438190457814
2015-07-29 10:20:54
155
time
background/location
460.203
0
0
0
346412304000000
True
False
False
...
-122.141467
fused
[0, 0]
0
1438197502909
android
0
message
1438197504303
2015-07-29 12:18:22
159
time
background/location
434.455
0
0
0
346532418000000
True
False
False
...
-122.113038
fused
[0, 0]
0
1438197623024
android
0
message
1438197624346
2015-07-29 12:20:23
164
time
background/location
419.824
0
0
0
346682535000000
True
False
False
...
-122.101123
fused
[0, 0]
0
1438197773109
android
0
message
1438197774429
2015-07-29 12:22:53
6 rows × 28 columns
In [19]:
tidx = df[df.mAccuracy > 200].index; tidx
Out[19]:
Int64Index([60, 65, 75, 155, 159, 164], dtype='int64')
In [20]:
df.loc[tidx]
Out[20]:
filter
key
mAccuracy
mAltitude
mBearing
mDistance
mElapsedRealtimeNanos
mHasAccuracy
mHasAltitude
mHasBearing
...
mLongitude
mProvider
mResults
mSpeed
mTime
platform
read_ts
type
write_ts
formatted_time
60
time
background/location
453.212
0
0
0
338915173000000
True
False
False
...
-122.076251
fused
[0, 0]
0
1438190005779
android
0
message
1438190006628
2015-07-29 10:13:25
65
time
background/location
417.357
0
0
0
339063466000000
True
False
False
...
-122.094375
fused
[0, 0]
0
1438190154072
android
0
message
1438190157622
2015-07-29 10:15:54
75
time
background/location
428.671
0
0
0
339363946000000
True
False
False
...
-122.136062
fused
[0, 0]
0
1438190454552
android
0
message
1438190457814
2015-07-29 10:20:54
155
time
background/location
460.203
0
0
0
346412304000000
True
False
False
...
-122.141467
fused
[0, 0]
0
1438197502909
android
0
message
1438197504303
2015-07-29 12:18:22
159
time
background/location
434.455
0
0
0
346532418000000
True
False
False
...
-122.113038
fused
[0, 0]
0
1438197623024
android
0
message
1438197624346
2015-07-29 12:20:23
164
time
background/location
419.824
0
0
0
346682535000000
True
False
False
...
-122.101123
fused
[0, 0]
0
1438197773109
android
0
message
1438197774429
2015-07-29 12:22:53
6 rows × 28 columns
In [21]:
max(tidx)
Out[21]:
164
In [22]:
min(tidx)
Out[22]:
60
In [23]:
def get_map_list(user_id, loc_filter, start_dt, end_dt):
df = lq.get_plottable_df(user_id, loc_filter, start_dt, end_dt)
sp = lq.get_potential_split_index(df)
print "original split indices are %s" % sp
print df.formatted_time.iloc[sp]
return lo.get_map_list(df, sp)
In [24]:
def get_filtered_map_list(user_id, loc_filter, start_dt, end_dt):
df = lq.get_plottable_df(user_id, loc_filter, start_dt, end_dt)
filtered_df = df[df.mAccuracy < 200]
print "filtering points %s" % df[df.mAccuracy > 200].index
print "filtered list size went from %s to %s" % (df.shape, filtered_df.shape)
sp = lq.get_potential_split_index(filtered_df)
print "filtered split indices are %s" % sp
print df.formatted_time.loc[sp]
return lo.get_map_list(filtered_df, sp)
In [25]:
def get_filter_compare(user_id, loc_filter, start_dt, end_dt):
unfiltered_maps = get_map_list(user_id, loc_filter, start_dt, end_dt)
filtered_maps = get_filtered_map_list(user_id, loc_filter, start_dt, end_dt)
if len(unfiltered_maps) >= len(filtered_maps):
return zip(unfiltered_maps, filtered_maps)
else:
return [(b, a) for (a, b) in zip(filtered_maps, unfiltered_maps)]
In [26]:
import emission.analysis.plotting.leaflet_osm.ipython_helper as ipy
In [27]:
reload(ipy)
Out[27]:
<module 'emission.analysis.plotting.leaflet_osm.ipython_helper' from '/Users/shankari/e-mission/e-mission-server/emission/analysis/plotting/leaflet_osm/ipython_helper.pyc'>
In [28]:
my_time_filter_map_list_21 = get_filter_compare(lq.get_uuid_list()[0], "time", get_jul_dt(21), get_jul_dt(22))
ipy.inline_maps(my_time_filter_map_list_21, len(my_time_filter_map_list_21), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437465600000.0}}, {'data.mTime': {'$lt': 1437552000000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
original split indices are Int64Index([0, 484, 494, 523, 641, 923, 935, 1030, 1040, 1080, 1091, 1104, 1114], dtype='int64')
0 2015-07-21 08:22:15
484 2015-07-21 12:30:27
494 2015-07-21 13:21:30
523 2015-07-21 13:30:29
641 2015-07-21 14:41:11
923 2015-07-21 15:46:13
935 2015-07-21 15:54:49
1030 2015-07-21 17:38:30
1040 2015-07-21 18:07:49
1080 2015-07-21 18:19:38
1091 2015-07-21 18:47:23
1104 2015-07-21 19:00:12
1114 2015-07-21 19:02:22
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-21 08:22:15 to 2015-07-21 12:30:27 because start = 0 and end = 484
Considering trip from 2015-07-21 12:30:27 to 2015-07-21 13:21:30 because start = 484 and end = 494
Considering trip from 2015-07-21 13:21:30 to 2015-07-21 13:30:29 because start = 494 and end = 523
Considering trip from 2015-07-21 13:30:29 to 2015-07-21 14:41:11 because start = 523 and end = 641
Considering trip from 2015-07-21 14:41:11 to 2015-07-21 15:46:13 because start = 641 and end = 923
Considering trip from 2015-07-21 15:46:13 to 2015-07-21 15:54:49 because start = 923 and end = 935
Considering trip from 2015-07-21 15:54:49 to 2015-07-21 17:38:30 because start = 935 and end = 1030
Considering trip from 2015-07-21 17:38:30 to 2015-07-21 18:07:49 because start = 1030 and end = 1040
Considering trip from 2015-07-21 18:07:49 to 2015-07-21 18:19:38 because start = 1040 and end = 1080
Considering trip from 2015-07-21 18:19:38 to 2015-07-21 18:47:23 because start = 1080 and end = 1091
Considering trip from 2015-07-21 18:47:23 to 2015-07-21 19:00:12 because start = 1091 and end = 1104
Considering trip from 2015-07-21 19:00:12 to 2015-07-21 19:02:22 because start = 1104 and end = 1114
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437465600000.0}}, {'data.mTime': {'$lt': 1437552000000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
filtering points Int64Index([239, 484, 523, 532, 561, 564, 702, 796, 797, 798, 815, 833, 855, 856, 857, 858, 859, 860, 923, 924, 928, 1003, 1030, 1104], dtype='int64')
filtered list size went from (1115, 28) to (1091, 28)
filtered split indices are Int64Index([0, 485, 494, 524, 641, 925, 935, 1031, 1040, 1080, 1091, 1105, 1114], dtype='int64')
0 2015-07-21 08:22:15
485 2015-07-21 12:30:31
494 2015-07-21 13:21:30
524 2015-07-21 13:30:32
641 2015-07-21 14:41:11
925 2015-07-21 15:47:39
935 2015-07-21 15:54:49
1031 2015-07-21 17:38:34
1040 2015-07-21 18:07:49
1080 2015-07-21 18:19:38
1091 2015-07-21 18:47:23
1105 2015-07-21 19:01:12
1114 2015-07-21 19:02:22
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-21 08:22:15 to 2015-07-21 12:30:31 because start = 0 and end = 485
Considering trip from 2015-07-21 12:30:31 to 2015-07-21 13:21:30 because start = 485 and end = 494
Considering trip from 2015-07-21 13:21:30 to 2015-07-21 13:30:32 because start = 494 and end = 524
Considering trip from 2015-07-21 13:30:32 to 2015-07-21 14:41:11 because start = 524 and end = 641
Considering trip from 2015-07-21 14:41:11 to 2015-07-21 15:47:39 because start = 641 and end = 925
Considering trip from 2015-07-21 15:47:39 to 2015-07-21 15:54:49 because start = 925 and end = 935
Considering trip from 2015-07-21 15:54:49 to 2015-07-21 17:38:34 because start = 935 and end = 1031
Considering trip from 2015-07-21 17:38:34 to 2015-07-21 18:07:49 because start = 1031 and end = 1040
Considering trip from 2015-07-21 18:07:49 to 2015-07-21 18:19:38 because start = 1040 and end = 1080
Considering trip from 2015-07-21 18:19:38 to 2015-07-21 18:47:23 because start = 1080 and end = 1091
Considering trip from 2015-07-21 18:47:23 to 2015-07-21 19:01:12 because start = 1091 and end = 1105
Considering trip from 2015-07-21 19:01:12 to 2015-07-21 19:02:22 because start = 1105 and end = 1114
Out[28]:
In [29]:
my_dist_filter_map_list_21 = get_filter_compare(lq.get_uuid_list()[0], "distance", get_jul_dt(21), get_jul_dt(22))
ipy.inline_maps(my_dist_filter_map_list_21, len(my_dist_filter_map_list_21), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437465600000.0}}, {'data.mTime': {'$lt': 1437552000000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'distance'}
original split indices are Int64Index([0, 1, 103, 106, 112, 145, 213, 216, 235, 237, 245, 247, 251, 252], dtype='int64')
0 2015-07-21 08:22:15
1 2015-07-21 08:46:30
103 2015-07-21 12:30:27
106 2015-07-21 13:21:30
112 2015-07-21 13:30:29
145 2015-07-21 14:41:11
213 2015-07-21 15:46:13
216 2015-07-21 15:54:49
235 2015-07-21 17:38:30
237 2015-07-21 18:07:49
245 2015-07-21 18:19:38
247 2015-07-21 18:47:23
251 2015-07-21 19:00:12
252 2015-07-21 19:01:12
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-21 08:22:15 to 2015-07-21 08:46:30 because start = 0 and end = 1
Ignoring trip from 2015-07-21 08:22:15 to 2015-07-21 08:46:30 because start = 0 and end = 1
Considering trip from 2015-07-21 08:46:30 to 2015-07-21 12:30:27 because start = 1 and end = 103
Considering trip from 2015-07-21 12:30:27 to 2015-07-21 13:21:30 because start = 103 and end = 106
Ignoring trip from 2015-07-21 12:30:27 to 2015-07-21 13:21:30 because start = 103 and end = 106
Considering trip from 2015-07-21 13:21:30 to 2015-07-21 13:30:29 because start = 106 and end = 112
Considering trip from 2015-07-21 13:30:29 to 2015-07-21 14:41:11 because start = 112 and end = 145
Considering trip from 2015-07-21 14:41:11 to 2015-07-21 15:46:13 because start = 145 and end = 213
Considering trip from 2015-07-21 15:46:13 to 2015-07-21 15:54:49 because start = 213 and end = 216
Ignoring trip from 2015-07-21 15:46:13 to 2015-07-21 15:54:49 because start = 213 and end = 216
Considering trip from 2015-07-21 15:54:49 to 2015-07-21 17:38:30 because start = 216 and end = 235
Considering trip from 2015-07-21 17:38:30 to 2015-07-21 18:07:49 because start = 235 and end = 237
Ignoring trip from 2015-07-21 17:38:30 to 2015-07-21 18:07:49 because start = 235 and end = 237
Considering trip from 2015-07-21 18:07:49 to 2015-07-21 18:19:38 because start = 237 and end = 245
Considering trip from 2015-07-21 18:19:38 to 2015-07-21 18:47:23 because start = 245 and end = 247
Ignoring trip from 2015-07-21 18:19:38 to 2015-07-21 18:47:23 because start = 245 and end = 247
Considering trip from 2015-07-21 18:47:23 to 2015-07-21 19:00:12 because start = 247 and end = 251
Considering trip from 2015-07-21 19:00:12 to 2015-07-21 19:01:12 because start = 251 and end = 252
Ignoring trip from 2015-07-21 19:00:12 to 2015-07-21 19:01:12 because start = 251 and end = 252
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437465600000.0}}, {'data.mTime': {'$lt': 1437552000000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'distance'}
filtering points Int64Index([48, 103, 112, 116, 161, 190, 194, 213, 214, 229, 235, 251], dtype='int64')
filtered list size went from (253, 28) to (241, 28)
filtered split indices are Int64Index([0, 1, 104, 106, 113, 145, 215, 216, 236, 237, 245, 247, 252, 252], dtype='int64')
0 2015-07-21 08:22:15
1 2015-07-21 08:46:30
104 2015-07-21 12:30:30
106 2015-07-21 13:21:30
113 2015-07-21 13:30:32
145 2015-07-21 14:41:11
215 2015-07-21 15:47:39
216 2015-07-21 15:54:49
236 2015-07-21 17:38:34
237 2015-07-21 18:07:49
245 2015-07-21 18:19:38
247 2015-07-21 18:47:23
252 2015-07-21 19:01:12
252 2015-07-21 19:01:12
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-21 08:22:15 to 2015-07-21 08:46:30 because start = 0 and end = 1
Ignoring trip from 2015-07-21 08:22:15 to 2015-07-21 08:46:30 because start = 0 and end = 1
Considering trip from 2015-07-21 08:46:30 to 2015-07-21 12:30:30 because start = 1 and end = 104
Considering trip from 2015-07-21 12:30:30 to 2015-07-21 13:21:30 because start = 104 and end = 106
Ignoring trip from 2015-07-21 12:30:30 to 2015-07-21 13:21:30 because start = 104 and end = 106
Considering trip from 2015-07-21 13:21:30 to 2015-07-21 13:30:32 because start = 106 and end = 113
Considering trip from 2015-07-21 13:30:32 to 2015-07-21 14:41:11 because start = 113 and end = 145
Considering trip from 2015-07-21 14:41:11 to 2015-07-21 15:47:39 because start = 145 and end = 215
Considering trip from 2015-07-21 15:47:39 to 2015-07-21 15:54:49 because start = 215 and end = 216
Ignoring trip from 2015-07-21 15:47:39 to 2015-07-21 15:54:49 because start = 215 and end = 216
Considering trip from 2015-07-21 15:54:49 to 2015-07-21 17:38:34 because start = 216 and end = 236
Considering trip from 2015-07-21 17:38:34 to 2015-07-21 18:07:49 because start = 236 and end = 237
Ignoring trip from 2015-07-21 17:38:34 to 2015-07-21 18:07:49 because start = 236 and end = 237
Considering trip from 2015-07-21 18:07:49 to 2015-07-21 18:19:38 because start = 237 and end = 245
Considering trip from 2015-07-21 18:19:38 to 2015-07-21 18:47:23 because start = 245 and end = 247
Ignoring trip from 2015-07-21 18:19:38 to 2015-07-21 18:47:23 because start = 245 and end = 247
Considering trip from 2015-07-21 18:47:23 to 2015-07-21 19:01:12 because start = 247 and end = 252
Considering trip from 2015-07-21 19:01:12 to 2015-07-21 19:01:12 because start = 252 and end = 252
Ignoring trip from 2015-07-21 19:01:12 to 2015-07-21 19:01:12 because start = 252 and end = 252
Out[29]:
In [30]:
my_dist_filter_map_list_22 = get_filter_compare(lq.get_uuid_list()[0], "distance", get_jul_dt(22), get_jul_dt(23))
ipy.inline_maps(my_dist_filter_map_list_22, len(my_dist_filter_map_list_22), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437552000000.0}}, {'data.mTime': {'$lt': 1437638400000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'distance'}
original split indices are Int64Index([0, 59, 87, 90, 122, 128, 169, 172, 191, 195, 197], dtype='int64')
0 2015-07-22 08:14:53
59 2015-07-22 09:09:00
87 2015-07-22 09:26:56
90 2015-07-22 13:16:38
122 2015-07-22 14:41:15
128 2015-07-22 14:51:49
169 2015-07-22 16:02:29
172 2015-07-22 16:08:17
191 2015-07-22 17:51:17
195 2015-07-22 18:09:52
197 2015-07-22 18:14:22
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-22 08:14:53 to 2015-07-22 09:09:00 because start = 0 and end = 59
Considering trip from 2015-07-22 09:09:00 to 2015-07-22 09:26:56 because start = 59 and end = 87
Considering trip from 2015-07-22 09:26:56 to 2015-07-22 13:16:38 because start = 87 and end = 90
Ignoring trip from 2015-07-22 09:26:56 to 2015-07-22 13:16:38 because start = 87 and end = 90
Considering trip from 2015-07-22 13:16:38 to 2015-07-22 14:41:15 because start = 90 and end = 122
Considering trip from 2015-07-22 14:41:15 to 2015-07-22 14:51:49 because start = 122 and end = 128
Considering trip from 2015-07-22 14:51:49 to 2015-07-22 16:02:29 because start = 128 and end = 169
Considering trip from 2015-07-22 16:02:29 to 2015-07-22 16:08:17 because start = 169 and end = 172
Ignoring trip from 2015-07-22 16:02:29 to 2015-07-22 16:08:17 because start = 169 and end = 172
Considering trip from 2015-07-22 16:08:17 to 2015-07-22 17:51:17 because start = 172 and end = 191
Considering trip from 2015-07-22 17:51:17 to 2015-07-22 18:09:52 because start = 191 and end = 195
Considering trip from 2015-07-22 18:09:52 to 2015-07-22 18:14:22 because start = 195 and end = 197
Ignoring trip from 2015-07-22 18:09:52 to 2015-07-22 18:14:22 because start = 195 and end = 197
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437552000000.0}}, {'data.mTime': {'$lt': 1437638400000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'distance'}
filtering points Int64Index([19, 20, 25, 30, 61, 81, 108, 115, 129, 138, 169, 172, 174, 191, 192], dtype='int64')
filtered list size went from (198, 28) to (183, 28)
filtered split indices are Int64Index([0, 59, 87, 90, 122, 128, 170, 173, 193, 195, 197], dtype='int64')
0 2015-07-22 08:14:53
59 2015-07-22 09:09:00
87 2015-07-22 09:26:56
90 2015-07-22 13:16:38
122 2015-07-22 14:41:15
128 2015-07-22 14:51:49
170 2015-07-22 16:02:32
173 2015-07-22 16:08:20
193 2015-07-22 17:54:21
195 2015-07-22 18:09:52
197 2015-07-22 18:14:22
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-22 08:14:53 to 2015-07-22 09:09:00 because start = 0 and end = 59
Considering trip from 2015-07-22 09:09:00 to 2015-07-22 09:26:56 because start = 59 and end = 87
Considering trip from 2015-07-22 09:26:56 to 2015-07-22 13:16:38 because start = 87 and end = 90
Ignoring trip from 2015-07-22 09:26:56 to 2015-07-22 13:16:38 because start = 87 and end = 90
Considering trip from 2015-07-22 13:16:38 to 2015-07-22 14:41:15 because start = 90 and end = 122
Considering trip from 2015-07-22 14:41:15 to 2015-07-22 14:51:49 because start = 122 and end = 128
Considering trip from 2015-07-22 14:51:49 to 2015-07-22 16:02:32 because start = 128 and end = 170
Considering trip from 2015-07-22 16:02:32 to 2015-07-22 16:08:20 because start = 170 and end = 173
Ignoring trip from 2015-07-22 16:02:32 to 2015-07-22 16:08:20 because start = 170 and end = 173
Considering trip from 2015-07-22 16:08:20 to 2015-07-22 17:54:21 because start = 173 and end = 193
Considering trip from 2015-07-22 17:54:21 to 2015-07-22 18:09:52 because start = 193 and end = 195
Ignoring trip from 2015-07-22 17:54:21 to 2015-07-22 18:09:52 because start = 193 and end = 195
Considering trip from 2015-07-22 18:09:52 to 2015-07-22 18:14:22 because start = 195 and end = 197
Ignoring trip from 2015-07-22 18:09:52 to 2015-07-22 18:14:22 because start = 195 and end = 197
Out[30]:
In [31]:
my_time_filter_map_list_22 = get_filter_compare(lq.get_uuid_list()[0], "time", get_jul_dt(22), get_jul_dt(23))
ipy.inline_maps(my_time_filter_map_list_22, len(my_time_filter_map_list_22), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437552000000.0}}, {'data.mTime': {'$lt': 1437638400000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
original split indices are Int64Index([0, 181, 257, 372, 431, 432], dtype='int64')
0 2015-07-22 08:14:53
181 2015-07-22 13:16:38
257 2015-07-22 14:41:15
372 2015-07-22 16:02:29
431 2015-07-22 17:51:17
432 2015-07-22 17:54:21
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-22 08:14:53 to 2015-07-22 13:16:38 because start = 0 and end = 181
Considering trip from 2015-07-22 13:16:38 to 2015-07-22 14:41:15 because start = 181 and end = 257
Considering trip from 2015-07-22 14:41:15 to 2015-07-22 16:02:29 because start = 257 and end = 372
Considering trip from 2015-07-22 16:02:29 to 2015-07-22 17:51:17 because start = 372 and end = 431
Considering trip from 2015-07-22 17:51:17 to 2015-07-22 17:54:21 because start = 431 and end = 432
Ignoring trip from 2015-07-22 17:51:17 to 2015-07-22 17:54:21 because start = 431 and end = 432
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437552000000.0}}, {'data.mTime': {'$lt': 1437638400000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
filtering points Int64Index([33, 34, 51, 54, 61, 62, 124, 144, 145, 146, 216, 217, 218, 219, 221, 225, 226, 229, 235, 241, 276, 296, 298, 305, 311, 325, 372, 382, 384, 431], dtype='int64')
filtered list size went from (433, 28) to (403, 28)
filtered split indices are Int64Index([0, 181, 257, 373, 432, 432], dtype='int64')
0 2015-07-22 08:14:53
181 2015-07-22 13:16:38
257 2015-07-22 14:41:15
373 2015-07-22 16:02:32
432 2015-07-22 17:54:21
432 2015-07-22 17:54:21
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-22 08:14:53 to 2015-07-22 13:16:38 because start = 0 and end = 181
Considering trip from 2015-07-22 13:16:38 to 2015-07-22 14:41:15 because start = 181 and end = 257
Considering trip from 2015-07-22 14:41:15 to 2015-07-22 16:02:32 because start = 257 and end = 373
Considering trip from 2015-07-22 16:02:32 to 2015-07-22 17:54:21 because start = 373 and end = 432
Considering trip from 2015-07-22 17:54:21 to 2015-07-22 17:54:21 because start = 432 and end = 432
Ignoring trip from 2015-07-22 17:54:21 to 2015-07-22 17:54:21 because start = 432 and end = 432
Out[31]:
In [32]:
tom_time_filter_map_list_22 = get_filter_compare(lq.get_uuid_list()[2], "time", get_jul_dt(22), get_jul_dt(23))
ipy.inline_maps(tom_time_filter_map_list_22, len(tom_time_filter_map_list_22), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437552000000.0}}, {'data.mTime': {'$lt': 1437638400000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'time'}
original split indices are Int64Index([0, 10, 31, 74, 114, 138, 152, 161], dtype='int64')
0 2015-07-22 08:05:53
10 2015-07-22 08:26:15
31 2015-07-22 08:40:35
74 2015-07-22 17:47:30
114 2015-07-22 18:40:26
138 2015-07-22 23:14:15
152 2015-07-23 00:43:50
161 2015-07-23 00:48:05
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-22 08:05:53 to 2015-07-22 08:26:15 because start = 0 and end = 10
Considering trip from 2015-07-22 08:26:15 to 2015-07-22 08:40:35 because start = 10 and end = 31
Considering trip from 2015-07-22 08:40:35 to 2015-07-22 17:47:30 because start = 31 and end = 74
Considering trip from 2015-07-22 17:47:30 to 2015-07-22 18:40:26 because start = 74 and end = 114
Considering trip from 2015-07-22 18:40:26 to 2015-07-22 23:14:15 because start = 114 and end = 138
Considering trip from 2015-07-22 23:14:15 to 2015-07-23 00:43:50 because start = 138 and end = 152
Considering trip from 2015-07-23 00:43:50 to 2015-07-23 00:48:05 because start = 152 and end = 161
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437552000000.0}}, {'data.mTime': {'$lt': 1437638400000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'time'}
filtering points Int64Index([0, 10, 11, 12, 13, 14, 16, 20, 31, 32, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 58, 59, 60, 61, 62, 63, 79, 80, 81, 82, 83, 84, 86, 89, 90, 91, 92, 93, 94, 101, 114, 115, 116, 133, 138, 152], dtype='int64')
filtered list size went from (162, 28) to (106, 28)
filtered split indices are Int64Index([1, 15, 35, 56, 74, 117, 139, 153, 161], dtype='int64')
1 2015-07-22 08:05:57
15 2015-07-22 08:26:54
35 2015-07-22 08:42:08
56 2015-07-22 08:53:56
74 2015-07-22 17:47:30
117 2015-07-22 18:41:50
139 2015-07-22 23:14:20
153 2015-07-23 00:43:55
161 2015-07-23 00:48:05
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-22 08:05:57 to 2015-07-22 08:26:54 because start = 1 and end = 15
Considering trip from 2015-07-22 08:26:54 to 2015-07-22 08:42:08 because start = 15 and end = 35
Considering trip from 2015-07-22 08:42:08 to 2015-07-22 08:53:56 because start = 35 and end = 56
Considering trip from 2015-07-22 08:53:56 to 2015-07-22 17:47:30 because start = 56 and end = 74
Considering trip from 2015-07-22 17:47:30 to 2015-07-22 18:41:50 because start = 74 and end = 117
Considering trip from 2015-07-22 18:41:50 to 2015-07-22 23:14:20 because start = 117 and end = 139
Considering trip from 2015-07-22 23:14:20 to 2015-07-23 00:43:55 because start = 139 and end = 153
Considering trip from 2015-07-23 00:43:55 to 2015-07-23 00:48:05 because start = 153 and end = 161
Out[32]:
In [33]:
tom_dist_filter_map_list_22 = get_filter_compare(lq.get_uuid_list()[2], "distance", get_jul_dt(22), get_jul_dt(23))
ipy.inline_maps(tom_dist_filter_map_list_22, len(tom_dist_filter_map_list_22), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437552000000.0}}, {'data.mTime': {'$lt': 1437638400000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
original split indices are Int64Index([0, 2, 14, 23, 29, 48, 58, 60, 61], dtype='int64')
0 2015-07-22 08:05:53
2 2015-07-22 08:26:15
14 2015-07-22 08:40:35
23 2015-07-22 08:51:06
29 2015-07-22 17:47:30
48 2015-07-22 18:40:26
58 2015-07-22 23:14:15
60 2015-07-23 00:43:50
61 2015-07-23 00:43:55
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-22 08:05:53 to 2015-07-22 08:26:15 because start = 0 and end = 2
Ignoring trip from 2015-07-22 08:05:53 to 2015-07-22 08:26:15 because start = 0 and end = 2
Considering trip from 2015-07-22 08:26:15 to 2015-07-22 08:40:35 because start = 2 and end = 14
Considering trip from 2015-07-22 08:40:35 to 2015-07-22 08:51:06 because start = 14 and end = 23
Considering trip from 2015-07-22 08:51:06 to 2015-07-22 17:47:30 because start = 23 and end = 29
Considering trip from 2015-07-22 17:47:30 to 2015-07-22 18:40:26 because start = 29 and end = 48
Considering trip from 2015-07-22 18:40:26 to 2015-07-22 23:14:15 because start = 48 and end = 58
Considering trip from 2015-07-22 23:14:15 to 2015-07-23 00:43:50 because start = 58 and end = 60
Ignoring trip from 2015-07-22 23:14:15 to 2015-07-23 00:43:50 because start = 58 and end = 60
Considering trip from 2015-07-23 00:43:50 to 2015-07-23 00:43:55 because start = 60 and end = 61
Ignoring trip from 2015-07-23 00:43:50 to 2015-07-23 00:43:55 because start = 60 and end = 61
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437552000000.0}}, {'data.mTime': {'$lt': 1437638400000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
filtering points Int64Index([0, 2, 3, 4, 5, 6, 8, 12, 14, 15, 16, 17, 21, 22, 23, 24, 25, 27, 34, 36, 39, 44, 48, 49, 58, 60], dtype='int64')
filtered list size went from (62, 28) to (36, 28)
filtered split indices are Int64Index([1, 7, 18, 26, 29, 50, 59, 61, 61], dtype='int64')
1 2015-07-22 08:05:57
7 2015-07-22 08:26:54
18 2015-07-22 08:42:08
26 2015-07-22 08:53:56
29 2015-07-22 17:47:30
50 2015-07-22 18:41:50
59 2015-07-22 23:14:20
61 2015-07-23 00:43:55
61 2015-07-23 00:43:55
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-22 08:05:57 to 2015-07-22 08:26:54 because start = 1 and end = 7
Considering trip from 2015-07-22 08:26:54 to 2015-07-22 08:42:08 because start = 7 and end = 18
Considering trip from 2015-07-22 08:42:08 to 2015-07-22 08:53:56 because start = 18 and end = 26
Considering trip from 2015-07-22 08:53:56 to 2015-07-22 17:47:30 because start = 26 and end = 29
Ignoring trip from 2015-07-22 08:53:56 to 2015-07-22 17:47:30 because start = 26 and end = 29
Considering trip from 2015-07-22 17:47:30 to 2015-07-22 18:41:50 because start = 29 and end = 50
Considering trip from 2015-07-22 18:41:50 to 2015-07-22 23:14:20 because start = 50 and end = 59
Considering trip from 2015-07-22 23:14:20 to 2015-07-23 00:43:55 because start = 59 and end = 61
Ignoring trip from 2015-07-22 23:14:20 to 2015-07-23 00:43:55 because start = 59 and end = 61
Considering trip from 2015-07-23 00:43:55 to 2015-07-23 00:43:55 because start = 61 and end = 61
Ignoring trip from 2015-07-23 00:43:55 to 2015-07-23 00:43:55 because start = 61 and end = 61
Out[33]:
In [34]:
import numpy as np
In [35]:
df[df.mLatitude == 37.262226300000002][["mAccuracy", "mTime", "mElapsedRealtimeNanos"]]
Out[35]:
mAccuracy
mTime
mElapsedRealtimeNanos
In [36]:
tom_dist_filter_map_list_23 = get_filter_compare(lq.get_uuid_list()[2], "distance", get_jul_dt(23), get_jul_dt(24))
ipy.inline_maps(tom_dist_filter_map_list_23, len(tom_dist_filter_map_list_23), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437638400000.0}}, {'data.mTime': {'$lt': 1437724800000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
original split indices are Int64Index([0, 2, 4, 64, 66, 77, 80, 110, 127, 238, 241, 245, 248], dtype='int64')
0 2015-07-23 01:14:32
2 2015-07-23 08:09:59
4 2015-07-23 08:16:09
64 2015-07-23 09:19:23
66 2015-07-23 09:28:08
77 2015-07-23 09:45:57
80 2015-07-23 09:56:17
110 2015-07-23 14:36:50
127 2015-07-23 15:04:13
238 2015-07-23 16:55:58
241 2015-07-23 17:15:31
245 2015-07-23 19:51:32
248 2015-07-23 19:59:22
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-23 01:14:32 to 2015-07-23 08:09:59 because start = 0 and end = 2
Ignoring trip from 2015-07-23 01:14:32 to 2015-07-23 08:09:59 because start = 0 and end = 2
Considering trip from 2015-07-23 08:09:59 to 2015-07-23 08:16:09 because start = 2 and end = 4
Ignoring trip from 2015-07-23 08:09:59 to 2015-07-23 08:16:09 because start = 2 and end = 4
Considering trip from 2015-07-23 08:16:09 to 2015-07-23 09:19:23 because start = 4 and end = 64
Considering trip from 2015-07-23 09:19:23 to 2015-07-23 09:28:08 because start = 64 and end = 66
Ignoring trip from 2015-07-23 09:19:23 to 2015-07-23 09:28:08 because start = 64 and end = 66
Considering trip from 2015-07-23 09:28:08 to 2015-07-23 09:45:57 because start = 66 and end = 77
Considering trip from 2015-07-23 09:45:57 to 2015-07-23 09:56:17 because start = 77 and end = 80
Ignoring trip from 2015-07-23 09:45:57 to 2015-07-23 09:56:17 because start = 77 and end = 80
Considering trip from 2015-07-23 09:56:17 to 2015-07-23 14:36:50 because start = 80 and end = 110
Considering trip from 2015-07-23 14:36:50 to 2015-07-23 15:04:13 because start = 110 and end = 127
Considering trip from 2015-07-23 15:04:13 to 2015-07-23 16:55:58 because start = 127 and end = 238
Considering trip from 2015-07-23 16:55:58 to 2015-07-23 17:15:31 because start = 238 and end = 241
Ignoring trip from 2015-07-23 16:55:58 to 2015-07-23 17:15:31 because start = 238 and end = 241
Considering trip from 2015-07-23 17:15:31 to 2015-07-23 19:51:32 because start = 241 and end = 245
Considering trip from 2015-07-23 19:51:32 to 2015-07-23 19:59:22 because start = 245 and end = 248
Ignoring trip from 2015-07-23 19:51:32 to 2015-07-23 19:59:22 because start = 245 and end = 248
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437638400000.0}}, {'data.mTime': {'$lt': 1437724800000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
filtering points Int64Index([0, 2, 61, 65, 66, 71, 77, 79, 80, 87, 88, 99, 120, 123, 125, 127, 129, 132, 133, 134, 135, 136, 152, 156, 158, 163, 165, 166, 168, 171, 173, 177, 179, 190, 192, 196, 208, 210, 213, 219, 224, 228, 230, 232], dtype='int64')
filtered list size went from (249, 28) to (205, 28)
filtered split indices are Int64Index([1, 3, 4, 64, 67, 78, 81, 110, 128, 137, 164, 238, 241, 245, 248], dtype='int64')
1 2015-07-23 01:14:37
3 2015-07-23 08:10:04
4 2015-07-23 08:16:09
64 2015-07-23 09:19:23
67 2015-07-23 09:29:14
78 2015-07-23 09:46:32
81 2015-07-23 09:56:53
110 2015-07-23 14:36:50
128 2015-07-23 15:05:21
137 2015-07-23 15:13:24
164 2015-07-23 15:45:30
238 2015-07-23 16:55:58
241 2015-07-23 17:15:31
245 2015-07-23 19:51:32
248 2015-07-23 19:59:22
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-23 01:14:37 to 2015-07-23 08:10:04 because start = 1 and end = 3
Ignoring trip from 2015-07-23 01:14:37 to 2015-07-23 08:10:04 because start = 1 and end = 3
Considering trip from 2015-07-23 08:10:04 to 2015-07-23 08:16:09 because start = 3 and end = 4
Ignoring trip from 2015-07-23 08:10:04 to 2015-07-23 08:16:09 because start = 3 and end = 4
Considering trip from 2015-07-23 08:16:09 to 2015-07-23 09:19:23 because start = 4 and end = 64
Considering trip from 2015-07-23 09:19:23 to 2015-07-23 09:29:14 because start = 64 and end = 67
Ignoring trip from 2015-07-23 09:19:23 to 2015-07-23 09:29:14 because start = 64 and end = 67
Considering trip from 2015-07-23 09:29:14 to 2015-07-23 09:46:32 because start = 67 and end = 78
Considering trip from 2015-07-23 09:46:32 to 2015-07-23 09:56:53 because start = 78 and end = 81
Ignoring trip from 2015-07-23 09:46:32 to 2015-07-23 09:56:53 because start = 78 and end = 81
Considering trip from 2015-07-23 09:56:53 to 2015-07-23 14:36:50 because start = 81 and end = 110
Considering trip from 2015-07-23 14:36:50 to 2015-07-23 15:05:21 because start = 110 and end = 128
Considering trip from 2015-07-23 15:05:21 to 2015-07-23 15:13:24 because start = 128 and end = 137
Considering trip from 2015-07-23 15:13:24 to 2015-07-23 15:45:30 because start = 137 and end = 164
Considering trip from 2015-07-23 15:45:30 to 2015-07-23 16:55:58 because start = 164 and end = 238
Considering trip from 2015-07-23 16:55:58 to 2015-07-23 17:15:31 because start = 238 and end = 241
Ignoring trip from 2015-07-23 16:55:58 to 2015-07-23 17:15:31 because start = 238 and end = 241
Considering trip from 2015-07-23 17:15:31 to 2015-07-23 19:51:32 because start = 241 and end = 245
Considering trip from 2015-07-23 19:51:32 to 2015-07-23 19:59:22 because start = 245 and end = 248
Ignoring trip from 2015-07-23 19:51:32 to 2015-07-23 19:59:22 because start = 245 and end = 248
Out[36]:
In [37]:
my_time_filter_map_list_23 = get_filter_compare(lq.get_uuid_list()[0], "time", get_jul_dt(23), get_jul_dt(24))
ipy.inline_maps(my_time_filter_map_list_23, len(my_time_filter_map_list_23), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437638400000.0}}, {'data.mTime': {'$lt': 1437724800000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
original split indices are Int64Index([0, 135, 217, 458, 459, 469, 479, 503], dtype='int64')
0 2015-07-23 08:16:14
135 2015-07-23 09:51:10
217 2015-07-23 14:30:59
458 2015-07-23 16:46:47
459 2015-07-23 16:53:47
469 2015-07-23 19:40:05
479 2015-07-23 21:09:45
503 2015-07-23 21:21:06
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-23 08:16:14 to 2015-07-23 09:51:10 because start = 0 and end = 135
Considering trip from 2015-07-23 09:51:10 to 2015-07-23 14:30:59 because start = 135 and end = 217
Considering trip from 2015-07-23 14:30:59 to 2015-07-23 16:46:47 because start = 217 and end = 458
Considering trip from 2015-07-23 16:46:47 to 2015-07-23 16:53:47 because start = 458 and end = 459
Ignoring trip from 2015-07-23 16:46:47 to 2015-07-23 16:53:47 because start = 458 and end = 459
Considering trip from 2015-07-23 16:53:47 to 2015-07-23 19:40:05 because start = 459 and end = 469
Considering trip from 2015-07-23 19:40:05 to 2015-07-23 21:09:45 because start = 469 and end = 479
Considering trip from 2015-07-23 21:09:45 to 2015-07-23 21:21:06 because start = 479 and end = 503
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437638400000.0}}, {'data.mTime': {'$lt': 1437724800000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
filtering points Int64Index([41, 42, 43, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 67, 68, 70, 76, 81, 82, 83, 84, 91, 96, 101, 102, 105, 106, 109, 110, 111, 113, 114, 117, 118, 119, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 161, 162, 165, 166, 167, 168, 169, 170, 171, 172, 173, 194, 217, 232, 233, 249, 250, 251, 252, 253, 254, 255, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, ...], dtype='int64')
filtered list size went from (504, 28) to (324, 28)
filtered split indices are Int64Index([0, 62, 144, 159, 174, 218, 293, 309, 377, 444, 458, 459, 470, 479, 503], dtype='int64')
0 2015-07-23 08:16:14
62 2015-07-23 08:35:14
144 2015-07-23 09:57:43
159 2015-07-23 10:05:46
174 2015-07-23 10:13:20
218 2015-07-23 14:31:07
293 2015-07-23 15:04:29
309 2015-07-23 15:13:29
377 2015-07-23 15:51:42
444 2015-07-23 16:29:15
458 2015-07-23 16:46:47
459 2015-07-23 16:53:47
470 2015-07-23 19:40:08
479 2015-07-23 21:09:45
503 2015-07-23 21:21:06
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-23 08:16:14 to 2015-07-23 08:35:14 because start = 0 and end = 62
Considering trip from 2015-07-23 08:35:14 to 2015-07-23 09:57:43 because start = 62 and end = 144
Considering trip from 2015-07-23 09:57:43 to 2015-07-23 10:05:46 because start = 144 and end = 159
Considering trip from 2015-07-23 10:05:46 to 2015-07-23 10:13:20 because start = 159 and end = 174
Considering trip from 2015-07-23 10:13:20 to 2015-07-23 14:31:07 because start = 174 and end = 218
Considering trip from 2015-07-23 14:31:07 to 2015-07-23 15:04:29 because start = 218 and end = 293
Considering trip from 2015-07-23 15:04:29 to 2015-07-23 15:13:29 because start = 293 and end = 309
Considering trip from 2015-07-23 15:13:29 to 2015-07-23 15:51:42 because start = 309 and end = 377
Considering trip from 2015-07-23 15:51:42 to 2015-07-23 16:29:15 because start = 377 and end = 444
Considering trip from 2015-07-23 16:29:15 to 2015-07-23 16:46:47 because start = 444 and end = 458
Considering trip from 2015-07-23 16:46:47 to 2015-07-23 16:53:47 because start = 458 and end = 459
Ignoring trip from 2015-07-23 16:46:47 to 2015-07-23 16:53:47 because start = 458 and end = 459
Considering trip from 2015-07-23 16:53:47 to 2015-07-23 19:40:08 because start = 459 and end = 470
Considering trip from 2015-07-23 19:40:08 to 2015-07-23 21:09:45 because start = 470 and end = 479
Considering trip from 2015-07-23 21:09:45 to 2015-07-23 21:21:06 because start = 479 and end = 503
Out[37]:
In [38]:
my_time_filter_map_list_24 = get_filter_compare(lq.get_uuid_list()[0], "time", get_jul_dt(24), get_jul_dt(25))
ipy.inline_maps(my_time_filter_map_list_24, len(my_time_filter_map_list_24), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437724800000.0}}, {'data.mTime': {'$lt': 1437811200000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
original split indices are Int64Index([0, 64, 125, 136, 224, 270, 296, 297, 306, 334], dtype='int64')
0 2015-07-24 07:50:40
64 2015-07-24 08:37:08
125 2015-07-24 15:54:38
136 2015-07-24 16:42:29
224 2015-07-24 17:21:31
270 2015-07-24 17:54:48
296 2015-07-24 18:29:27
297 2015-07-24 18:50:18
306 2015-07-24 19:12:24
334 2015-07-24 19:26:41
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-24 07:50:40 to 2015-07-24 08:37:08 because start = 0 and end = 64
Considering trip from 2015-07-24 08:37:08 to 2015-07-24 15:54:38 because start = 64 and end = 125
Considering trip from 2015-07-24 15:54:38 to 2015-07-24 16:42:29 because start = 125 and end = 136
Considering trip from 2015-07-24 16:42:29 to 2015-07-24 17:21:31 because start = 136 and end = 224
Considering trip from 2015-07-24 17:21:31 to 2015-07-24 17:54:48 because start = 224 and end = 270
Considering trip from 2015-07-24 17:54:48 to 2015-07-24 18:29:27 because start = 270 and end = 296
Considering trip from 2015-07-24 18:29:27 to 2015-07-24 18:50:18 because start = 296 and end = 297
Ignoring trip from 2015-07-24 18:29:27 to 2015-07-24 18:50:18 because start = 296 and end = 297
Considering trip from 2015-07-24 18:50:18 to 2015-07-24 19:12:24 because start = 297 and end = 306
Considering trip from 2015-07-24 19:12:24 to 2015-07-24 19:26:41 because start = 306 and end = 334
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437724800000.0}}, {'data.mTime': {'$lt': 1437811200000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
filtering points Int64Index([24, 26, 30, 45, 64, 79, 80, 125, 147, 149, 150, 166, 189, 200, 202, 214, 215, 219, 224, 226, 228, 238, 276, 296, 298], dtype='int64')
filtered list size went from (335, 28) to (310, 28)
filtered split indices are Int64Index([0, 65, 126, 136, 225, 270, 297, 306, 334], dtype='int64')
0 2015-07-24 07:50:40
65 2015-07-24 08:37:11
126 2015-07-24 15:54:40
136 2015-07-24 16:42:29
225 2015-07-24 17:21:34
270 2015-07-24 17:54:48
297 2015-07-24 18:50:18
306 2015-07-24 19:12:24
334 2015-07-24 19:26:41
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-24 07:50:40 to 2015-07-24 08:37:11 because start = 0 and end = 65
Considering trip from 2015-07-24 08:37:11 to 2015-07-24 15:54:40 because start = 65 and end = 126
Considering trip from 2015-07-24 15:54:40 to 2015-07-24 16:42:29 because start = 126 and end = 136
Considering trip from 2015-07-24 16:42:29 to 2015-07-24 17:21:34 because start = 136 and end = 225
Considering trip from 2015-07-24 17:21:34 to 2015-07-24 17:54:48 because start = 225 and end = 270
Considering trip from 2015-07-24 17:54:48 to 2015-07-24 18:50:18 because start = 270 and end = 297
Considering trip from 2015-07-24 18:50:18 to 2015-07-24 19:12:24 because start = 297 and end = 306
Considering trip from 2015-07-24 19:12:24 to 2015-07-24 19:26:41 because start = 306 and end = 334
Out[38]:
In [39]:
tom_dist_filter_map_list_24 = get_filter_compare(lq.get_uuid_list()[2], "distance", get_jul_dt(24), get_jul_dt(25))
ipy.inline_maps(tom_dist_filter_map_list_24, len(tom_dist_filter_map_list_24), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437724800000.0}}, {'data.mTime': {'$lt': 1437811200000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
original split indices are Int64Index([0, 22, 52, 60, 61, 88], dtype='int64')
0 2015-07-24 08:15:56
22 2015-07-24 14:08:08
52 2015-07-24 14:47:13
60 2015-07-24 15:04:56
61 2015-07-24 15:14:14
88 2015-07-24 15:52:32
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-24 08:15:56 to 2015-07-24 14:08:08 because start = 0 and end = 22
Considering trip from 2015-07-24 14:08:08 to 2015-07-24 14:47:13 because start = 22 and end = 52
Considering trip from 2015-07-24 14:47:13 to 2015-07-24 15:04:56 because start = 52 and end = 60
Considering trip from 2015-07-24 15:04:56 to 2015-07-24 15:14:14 because start = 60 and end = 61
Ignoring trip from 2015-07-24 15:04:56 to 2015-07-24 15:14:14 because start = 60 and end = 61
Considering trip from 2015-07-24 15:14:14 to 2015-07-24 15:52:32 because start = 61 and end = 88
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437724800000.0}}, {'data.mTime': {'$lt': 1437811200000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
filtering points Int64Index([24, 30, 76, 77], dtype='int64')
filtered list size went from (89, 28) to (85, 28)
filtered split indices are Int64Index([0, 22, 52, 60, 61, 88], dtype='int64')
0 2015-07-24 08:15:56
22 2015-07-24 14:08:08
52 2015-07-24 14:47:13
60 2015-07-24 15:04:56
61 2015-07-24 15:14:14
88 2015-07-24 15:52:32
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-24 08:15:56 to 2015-07-24 14:08:08 because start = 0 and end = 22
Considering trip from 2015-07-24 14:08:08 to 2015-07-24 14:47:13 because start = 22 and end = 52
Considering trip from 2015-07-24 14:47:13 to 2015-07-24 15:04:56 because start = 52 and end = 60
Considering trip from 2015-07-24 15:04:56 to 2015-07-24 15:14:14 because start = 60 and end = 61
Ignoring trip from 2015-07-24 15:04:56 to 2015-07-24 15:14:14 because start = 60 and end = 61
Considering trip from 2015-07-24 15:14:14 to 2015-07-24 15:52:32 because start = 61 and end = 88
Out[39]:
In [40]:
tom_dist_filter_map_list_25 = get_filter_compare(lq.get_uuid_list()[2], "distance", get_jul_dt(25), get_jul_dt(26))
ipy.inline_maps(tom_dist_filter_map_list_25, len(tom_dist_filter_map_list_25), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437811200000.0}}, {'data.mTime': {'$lt': 1437897600000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
original split indices are Int64Index([0, 5, 12, 20, 30], dtype='int64')
0 2015-07-25 10:13:31
5 2015-07-25 10:55:29
12 2015-07-25 15:25:13
20 2015-07-25 16:28:01
30 2015-07-25 16:38:23
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-25 10:13:31 to 2015-07-25 10:55:29 because start = 0 and end = 5
Considering trip from 2015-07-25 10:55:29 to 2015-07-25 15:25:13 because start = 5 and end = 12
Considering trip from 2015-07-25 15:25:13 to 2015-07-25 16:28:01 because start = 12 and end = 20
Considering trip from 2015-07-25 16:28:01 to 2015-07-25 16:38:23 because start = 20 and end = 30
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437811200000.0}}, {'data.mTime': {'$lt': 1437897600000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
filtering points Int64Index([], dtype='int64')
filtered list size went from (31, 28) to (31, 28)
filtered split indices are Int64Index([0, 5, 12, 20, 30], dtype='int64')
0 2015-07-25 10:13:31
5 2015-07-25 10:55:29
12 2015-07-25 15:25:13
20 2015-07-25 16:28:01
30 2015-07-25 16:38:23
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-25 10:13:31 to 2015-07-25 10:55:29 because start = 0 and end = 5
Considering trip from 2015-07-25 10:55:29 to 2015-07-25 15:25:13 because start = 5 and end = 12
Considering trip from 2015-07-25 15:25:13 to 2015-07-25 16:28:01 because start = 12 and end = 20
Considering trip from 2015-07-25 16:28:01 to 2015-07-25 16:38:23 because start = 20 and end = 30
Out[40]:
In [41]:
tom_dist_filter_map_list_27 = get_filter_compare(lq.get_uuid_list()[2], "distance", get_jul_dt(27), get_jul_dt(28))
ipy.inline_maps(tom_dist_filter_map_list_27, len(tom_dist_filter_map_list_27), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437984000000.0}}, {'data.mTime': {'$lt': 1438070400000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
original split indices are Int64Index([0, 2, 4, 6, 18, 19, 20, 32, 33, 90, 95, 111, 123, 126, 152, 163, 165, 167, 168, 182, 186, 186], dtype='int64')
0 2015-07-27 07:40:04
2 2015-07-27 08:04:03
4 2015-07-27 08:36:17
6 2015-07-27 08:50:00
18 2015-07-27 09:17:09
19 2015-07-27 09:22:39
20 2015-07-27 09:29:03
32 2015-07-27 09:53:51
33 2015-07-27 10:05:25
90 2015-07-27 11:11:30
95 2015-07-27 11:22:29
111 2015-07-27 11:48:48
123 2015-07-27 12:12:02
126 2015-07-27 12:22:46
152 2015-07-27 12:56:06
163 2015-07-27 13:19:03
165 2015-07-27 13:27:23
167 2015-07-27 13:35:27
168 2015-07-27 13:51:06
182 2015-07-27 17:27:47
186 2015-07-27 18:45:54
186 2015-07-27 18:45:54
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-27 07:40:04 to 2015-07-27 08:04:03 because start = 0 and end = 2
Ignoring trip from 2015-07-27 07:40:04 to 2015-07-27 08:04:03 because start = 0 and end = 2
Considering trip from 2015-07-27 08:04:03 to 2015-07-27 08:36:17 because start = 2 and end = 4
Ignoring trip from 2015-07-27 08:04:03 to 2015-07-27 08:36:17 because start = 2 and end = 4
Considering trip from 2015-07-27 08:36:17 to 2015-07-27 08:50:00 because start = 4 and end = 6
Ignoring trip from 2015-07-27 08:36:17 to 2015-07-27 08:50:00 because start = 4 and end = 6
Considering trip from 2015-07-27 08:50:00 to 2015-07-27 09:17:09 because start = 6 and end = 18
Considering trip from 2015-07-27 09:17:09 to 2015-07-27 09:22:39 because start = 18 and end = 19
Ignoring trip from 2015-07-27 09:17:09 to 2015-07-27 09:22:39 because start = 18 and end = 19
Considering trip from 2015-07-27 09:22:39 to 2015-07-27 09:29:03 because start = 19 and end = 20
Ignoring trip from 2015-07-27 09:22:39 to 2015-07-27 09:29:03 because start = 19 and end = 20
Considering trip from 2015-07-27 09:29:03 to 2015-07-27 09:53:51 because start = 20 and end = 32
Considering trip from 2015-07-27 09:53:51 to 2015-07-27 10:05:25 because start = 32 and end = 33
Ignoring trip from 2015-07-27 09:53:51 to 2015-07-27 10:05:25 because start = 32 and end = 33
Considering trip from 2015-07-27 10:05:25 to 2015-07-27 11:11:30 because start = 33 and end = 90
Considering trip from 2015-07-27 11:11:30 to 2015-07-27 11:22:29 because start = 90 and end = 95
Considering trip from 2015-07-27 11:22:29 to 2015-07-27 11:48:48 because start = 95 and end = 111
Considering trip from 2015-07-27 11:48:48 to 2015-07-27 12:12:02 because start = 111 and end = 123
Considering trip from 2015-07-27 12:12:02 to 2015-07-27 12:22:46 because start = 123 and end = 126
Ignoring trip from 2015-07-27 12:12:02 to 2015-07-27 12:22:46 because start = 123 and end = 126
Considering trip from 2015-07-27 12:22:46 to 2015-07-27 12:56:06 because start = 126 and end = 152
Considering trip from 2015-07-27 12:56:06 to 2015-07-27 13:19:03 because start = 152 and end = 163
Considering trip from 2015-07-27 13:19:03 to 2015-07-27 13:27:23 because start = 163 and end = 165
Ignoring trip from 2015-07-27 13:19:03 to 2015-07-27 13:27:23 because start = 163 and end = 165
Considering trip from 2015-07-27 13:27:23 to 2015-07-27 13:35:27 because start = 165 and end = 167
Ignoring trip from 2015-07-27 13:27:23 to 2015-07-27 13:35:27 because start = 165 and end = 167
Considering trip from 2015-07-27 13:35:27 to 2015-07-27 13:51:06 because start = 167 and end = 168
Ignoring trip from 2015-07-27 13:35:27 to 2015-07-27 13:51:06 because start = 167 and end = 168
Considering trip from 2015-07-27 13:51:06 to 2015-07-27 17:27:47 because start = 168 and end = 182
Considering trip from 2015-07-27 17:27:47 to 2015-07-27 18:45:54 because start = 182 and end = 186
Considering trip from 2015-07-27 18:45:54 to 2015-07-27 18:45:54 because start = 186 and end = 186
Ignoring trip from 2015-07-27 18:45:54 to 2015-07-27 18:45:54 because start = 186 and end = 186
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1437984000000.0}}, {'data.mTime': {'$lt': 1438070400000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
filtering points Int64Index([0, 1, 3, 5, 6, 7, 8, 9, 11, 13, 14, 15, 17, 18, 19, 20, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64, 66, 67, 71, 73, 75, 77, 79, 81, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, ...], dtype='int64')
filtered list size went from (187, 28) to (36, 28)
filtered split indices are Int64Index([2, 4, 10, 16, 21, 63, 121, 128, 165, 168, 178, 182, 183], dtype='int64')
2 2015-07-27 08:04:03
4 2015-07-27 08:36:17
10 2015-07-27 08:57:04
16 2015-07-27 09:06:16
21 2015-07-27 09:29:50
63 2015-07-27 10:41:41
121 2015-07-27 12:06:22
128 2015-07-27 12:24:22
165 2015-07-27 13:27:23
168 2015-07-27 13:51:06
178 2015-07-27 13:59:48
182 2015-07-27 17:27:47
183 2015-07-27 17:28:54
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-27 08:04:03 to 2015-07-27 08:36:17 because start = 2 and end = 4
Ignoring trip from 2015-07-27 08:04:03 to 2015-07-27 08:36:17 because start = 2 and end = 4
Considering trip from 2015-07-27 08:36:17 to 2015-07-27 08:57:04 because start = 4 and end = 10
Considering trip from 2015-07-27 08:57:04 to 2015-07-27 09:06:16 because start = 10 and end = 16
Considering trip from 2015-07-27 09:06:16 to 2015-07-27 09:29:50 because start = 16 and end = 21
Considering trip from 2015-07-27 09:29:50 to 2015-07-27 10:41:41 because start = 21 and end = 63
Considering trip from 2015-07-27 10:41:41 to 2015-07-27 12:06:22 because start = 63 and end = 121
Considering trip from 2015-07-27 12:06:22 to 2015-07-27 12:24:22 because start = 121 and end = 128
Considering trip from 2015-07-27 12:24:22 to 2015-07-27 13:27:23 because start = 128 and end = 165
Considering trip from 2015-07-27 13:27:23 to 2015-07-27 13:51:06 because start = 165 and end = 168
Ignoring trip from 2015-07-27 13:27:23 to 2015-07-27 13:51:06 because start = 165 and end = 168
Considering trip from 2015-07-27 13:51:06 to 2015-07-27 13:59:48 because start = 168 and end = 178
Considering trip from 2015-07-27 13:59:48 to 2015-07-27 17:27:47 because start = 178 and end = 182
Considering trip from 2015-07-27 17:27:47 to 2015-07-27 17:28:54 because start = 182 and end = 183
Ignoring trip from 2015-07-27 17:27:47 to 2015-07-27 17:28:54 because start = 182 and end = 183
Out[41]:
In [42]:
tom_dist_filter_map_list_28 = get_filter_compare(lq.get_uuid_list()[2], "distance", get_jul_dt(28), get_jul_dt(29))
ipy.inline_maps(tom_dist_filter_map_list_28, len(tom_dist_filter_map_list_28), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1438070400000.0}}, {'data.mTime': {'$lt': 1438156800000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
original split indices are Int64Index([0, 1, 2, 3, 4, 5, 6, 12, 19, 21, 27, 28, 29, 33, 54, 85, 111, 220], dtype='int64')
0 2015-07-28 06:49:08
1 2015-07-28 06:58:59
2 2015-07-28 07:30:29
3 2015-07-28 07:37:22
4 2015-07-28 07:48:52
5 2015-07-28 08:34:16
6 2015-07-28 08:50:38
12 2015-07-28 09:29:12
19 2015-07-28 09:42:46
21 2015-07-28 09:50:03
27 2015-07-28 09:58:50
28 2015-07-28 10:11:17
29 2015-07-28 10:18:02
33 2015-07-28 10:27:46
54 2015-07-28 13:46:52
85 2015-07-28 14:29:16
111 2015-07-28 15:08:12
220 2015-07-28 16:32:09
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-28 06:49:08 to 2015-07-28 06:58:59 because start = 0 and end = 1
Ignoring trip from 2015-07-28 06:49:08 to 2015-07-28 06:58:59 because start = 0 and end = 1
Considering trip from 2015-07-28 06:58:59 to 2015-07-28 07:30:29 because start = 1 and end = 2
Ignoring trip from 2015-07-28 06:58:59 to 2015-07-28 07:30:29 because start = 1 and end = 2
Considering trip from 2015-07-28 07:30:29 to 2015-07-28 07:37:22 because start = 2 and end = 3
Ignoring trip from 2015-07-28 07:30:29 to 2015-07-28 07:37:22 because start = 2 and end = 3
Considering trip from 2015-07-28 07:37:22 to 2015-07-28 07:48:52 because start = 3 and end = 4
Ignoring trip from 2015-07-28 07:37:22 to 2015-07-28 07:48:52 because start = 3 and end = 4
Considering trip from 2015-07-28 07:48:52 to 2015-07-28 08:34:16 because start = 4 and end = 5
Ignoring trip from 2015-07-28 07:48:52 to 2015-07-28 08:34:16 because start = 4 and end = 5
Considering trip from 2015-07-28 08:34:16 to 2015-07-28 08:50:38 because start = 5 and end = 6
Ignoring trip from 2015-07-28 08:34:16 to 2015-07-28 08:50:38 because start = 5 and end = 6
Considering trip from 2015-07-28 08:50:38 to 2015-07-28 09:29:12 because start = 6 and end = 12
Considering trip from 2015-07-28 09:29:12 to 2015-07-28 09:42:46 because start = 12 and end = 19
Considering trip from 2015-07-28 09:42:46 to 2015-07-28 09:50:03 because start = 19 and end = 21
Ignoring trip from 2015-07-28 09:42:46 to 2015-07-28 09:50:03 because start = 19 and end = 21
Considering trip from 2015-07-28 09:50:03 to 2015-07-28 09:58:50 because start = 21 and end = 27
Considering trip from 2015-07-28 09:58:50 to 2015-07-28 10:11:17 because start = 27 and end = 28
Ignoring trip from 2015-07-28 09:58:50 to 2015-07-28 10:11:17 because start = 27 and end = 28
Considering trip from 2015-07-28 10:11:17 to 2015-07-28 10:18:02 because start = 28 and end = 29
Ignoring trip from 2015-07-28 10:11:17 to 2015-07-28 10:18:02 because start = 28 and end = 29
Considering trip from 2015-07-28 10:18:02 to 2015-07-28 10:27:46 because start = 29 and end = 33
Considering trip from 2015-07-28 10:27:46 to 2015-07-28 13:46:52 because start = 33 and end = 54
Considering trip from 2015-07-28 13:46:52 to 2015-07-28 14:29:16 because start = 54 and end = 85
Considering trip from 2015-07-28 14:29:16 to 2015-07-28 15:08:12 because start = 85 and end = 111
Considering trip from 2015-07-28 15:08:12 to 2015-07-28 16:32:09 because start = 111 and end = 220
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1438070400000.0}}, {'data.mTime': {'$lt': 1438156800000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
filtering points Int64Index([5, 6, 7, 9, 11, 13, 16, 18, 20, 22, 24, 26, 27, 28, 30, 32, 34, 36, 38, 40, 41, 42, 43, 45, 49, 51, 53, 56, 58, 60, 65, 67, 68, 69, 70, 71, 109, 123, 129, 130, 140, 141, 146, 160, 164, 171, 199, 210], dtype='int64')
filtered list size went from (221, 28) to (173, 28)
filtered split indices are Int64Index([0, 1, 2, 3, 4, 8, 12, 19, 21, 29, 33, 44, 54, 72, 85, 111, 220], dtype='int64')
0 2015-07-28 06:49:08
1 2015-07-28 06:58:59
2 2015-07-28 07:30:29
3 2015-07-28 07:37:22
4 2015-07-28 07:48:52
8 2015-07-28 08:52:44
12 2015-07-28 09:29:12
19 2015-07-28 09:42:46
21 2015-07-28 09:50:03
29 2015-07-28 10:18:02
33 2015-07-28 10:27:46
44 2015-07-28 10:38:09
54 2015-07-28 13:46:52
72 2015-07-28 14:07:13
85 2015-07-28 14:29:16
111 2015-07-28 15:08:12
220 2015-07-28 16:32:09
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-28 06:49:08 to 2015-07-28 06:58:59 because start = 0 and end = 1
Ignoring trip from 2015-07-28 06:49:08 to 2015-07-28 06:58:59 because start = 0 and end = 1
Considering trip from 2015-07-28 06:58:59 to 2015-07-28 07:30:29 because start = 1 and end = 2
Ignoring trip from 2015-07-28 06:58:59 to 2015-07-28 07:30:29 because start = 1 and end = 2
Considering trip from 2015-07-28 07:30:29 to 2015-07-28 07:37:22 because start = 2 and end = 3
Ignoring trip from 2015-07-28 07:30:29 to 2015-07-28 07:37:22 because start = 2 and end = 3
Considering trip from 2015-07-28 07:37:22 to 2015-07-28 07:48:52 because start = 3 and end = 4
Ignoring trip from 2015-07-28 07:37:22 to 2015-07-28 07:48:52 because start = 3 and end = 4
Considering trip from 2015-07-28 07:48:52 to 2015-07-28 08:52:44 because start = 4 and end = 8
Considering trip from 2015-07-28 08:52:44 to 2015-07-28 09:29:12 because start = 8 and end = 12
Considering trip from 2015-07-28 09:29:12 to 2015-07-28 09:42:46 because start = 12 and end = 19
Considering trip from 2015-07-28 09:42:46 to 2015-07-28 09:50:03 because start = 19 and end = 21
Ignoring trip from 2015-07-28 09:42:46 to 2015-07-28 09:50:03 because start = 19 and end = 21
Considering trip from 2015-07-28 09:50:03 to 2015-07-28 10:18:02 because start = 21 and end = 29
Considering trip from 2015-07-28 10:18:02 to 2015-07-28 10:27:46 because start = 29 and end = 33
Considering trip from 2015-07-28 10:27:46 to 2015-07-28 10:38:09 because start = 33 and end = 44
Considering trip from 2015-07-28 10:38:09 to 2015-07-28 13:46:52 because start = 44 and end = 54
Considering trip from 2015-07-28 13:46:52 to 2015-07-28 14:07:13 because start = 54 and end = 72
Considering trip from 2015-07-28 14:07:13 to 2015-07-28 14:29:16 because start = 72 and end = 85
Considering trip from 2015-07-28 14:29:16 to 2015-07-28 15:08:12 because start = 85 and end = 111
Considering trip from 2015-07-28 15:08:12 to 2015-07-28 16:32:09 because start = 111 and end = 220
Out[42]:
In [43]:
tom_dist_filter_map_list_29 = get_filter_compare(lq.get_uuid_list()[2], "distance", get_jul_dt(29), get_jul_dt(30))
ipy.inline_maps(tom_dist_filter_map_list_29, len(tom_dist_filter_map_list_29), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1438156800000.0}}, {'data.mTime': {'$lt': 1438243200000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
original split indices are Int64Index([0, 52, 79, 93, 94, 98, 133, 137], dtype='int64')
0 2015-07-29 06:31:34
52 2015-07-29 07:18:32
79 2015-07-29 17:37:42
93 2015-07-29 18:01:39
94 2015-07-29 18:07:35
98 2015-07-29 18:21:45
133 2015-07-29 19:00:25
137 2015-07-29 19:05:06
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-29 06:31:34 to 2015-07-29 07:18:32 because start = 0 and end = 52
Considering trip from 2015-07-29 07:18:32 to 2015-07-29 17:37:42 because start = 52 and end = 79
Considering trip from 2015-07-29 17:37:42 to 2015-07-29 18:01:39 because start = 79 and end = 93
Considering trip from 2015-07-29 18:01:39 to 2015-07-29 18:07:35 because start = 93 and end = 94
Ignoring trip from 2015-07-29 18:01:39 to 2015-07-29 18:07:35 because start = 93 and end = 94
Considering trip from 2015-07-29 18:07:35 to 2015-07-29 18:21:45 because start = 94 and end = 98
Considering trip from 2015-07-29 18:21:45 to 2015-07-29 19:00:25 because start = 98 and end = 133
Considering trip from 2015-07-29 19:00:25 to 2015-07-29 19:05:06 because start = 133 and end = 137
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1438156800000.0}}, {'data.mTime': {'$lt': 1438243200000.0}}], 'user_id': UUID('b0d937d0-70ef-305e-9563-440369012b39'), 'metadata.filter': 'distance'}
filtering points Int64Index([93, 95, 105, 116, 122, 124, 126, 131], dtype='int64')
filtered list size went from (138, 28) to (130, 28)
filtered split indices are Int64Index([0, 52, 79, 94, 98, 133, 137], dtype='int64')
0 2015-07-29 06:31:34
52 2015-07-29 07:18:32
79 2015-07-29 17:37:42
94 2015-07-29 18:07:35
98 2015-07-29 18:21:45
133 2015-07-29 19:00:25
137 2015-07-29 19:05:06
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-07-29 06:31:34 to 2015-07-29 07:18:32 because start = 0 and end = 52
Considering trip from 2015-07-29 07:18:32 to 2015-07-29 17:37:42 because start = 52 and end = 79
Considering trip from 2015-07-29 17:37:42 to 2015-07-29 18:07:35 because start = 79 and end = 94
Considering trip from 2015-07-29 18:07:35 to 2015-07-29 18:21:45 because start = 94 and end = 98
Considering trip from 2015-07-29 18:21:45 to 2015-07-29 19:00:25 because start = 98 and end = 133
Considering trip from 2015-07-29 19:00:25 to 2015-07-29 19:05:06 because start = 133 and end = 137
Out[43]:
In [44]:
my_time_filter_map_list_6 = get_filter_compare(lq.get_uuid_list()[0], "time", get_aug_dt(6), get_aug_dt(7))
ipy.inline_maps(my_time_filter_map_list_6, len(my_time_filter_map_list_6), 2)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1438848000000.0}}, {'data.mTime': {'$lt': 1438934400000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
original split indices are Int64Index([0, 267, 268, 316], dtype='int64')
0 2015-08-06 08:31:14
267 2015-08-06 13:15:15
268 2015-08-06 15:45:06
316 2015-08-06 16:07:41
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-08-06 08:31:14 to 2015-08-06 13:15:15 because start = 0 and end = 267
Considering trip from 2015-08-06 13:15:15 to 2015-08-06 15:45:06 because start = 267 and end = 268
Ignoring trip from 2015-08-06 13:15:15 to 2015-08-06 15:45:06 because start = 267 and end = 268
Considering trip from 2015-08-06 15:45:06 to 2015-08-06 16:07:41 because start = 268 and end = 316
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1438848000000.0}}, {'data.mTime': {'$lt': 1438934400000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
filtering points Int64Index([3, 16, 17, 18, 19, 20, 22, 23, 26, 27, 29, 31, 32, 33, 34, 35, 38, 39, 40, 41, 44, 45, 53, 66, 67, 68, 69, 70, 73, 74, 75, 76, 77, 80, 81, 82, 83, 85, 87, 93, 105, 106, 115, 116, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, ...], dtype='int64')
filtered list size went from (317, 29) to (166, 29)
filtered split indices are Int64Index([0, 139, 172, 186, 203, 267, 268, 305], dtype='int64')
0 2015-08-06 08:31:14
139 2015-08-06 09:45:24
172 2015-08-06 10:02:24
186 2015-08-06 10:09:25
203 2015-08-06 10:18:58
267 2015-08-06 13:15:15
268 2015-08-06 15:45:06
305 2015-08-06 16:03:01
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-08-06 08:31:14 to 2015-08-06 09:45:24 because start = 0 and end = 139
Considering trip from 2015-08-06 09:45:24 to 2015-08-06 10:02:24 because start = 139 and end = 172
Considering trip from 2015-08-06 10:02:24 to 2015-08-06 10:09:25 because start = 172 and end = 186
Considering trip from 2015-08-06 10:09:25 to 2015-08-06 10:18:58 because start = 186 and end = 203
Considering trip from 2015-08-06 10:18:58 to 2015-08-06 13:15:15 because start = 203 and end = 267
Considering trip from 2015-08-06 13:15:15 to 2015-08-06 15:45:06 because start = 267 and end = 268
Ignoring trip from 2015-08-06 13:15:15 to 2015-08-06 15:45:06 because start = 267 and end = 268
Considering trip from 2015-08-06 15:45:06 to 2015-08-06 16:03:01 because start = 268 and end = 305
Out[44]:
In [45]:
unfiltered_maps = get_map_list(lq.get_uuid_list()[0], "time", get_aug_dt(6), get_aug_dt(7))
print len(unfiltered_maps)
filtered_maps = get_filtered_map_list(lq.get_uuid_list()[0], "time", get_aug_dt(6), get_aug_dt(7))
print len(filtered_maps)
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1438848000000.0}}, {'data.mTime': {'$lt': 1438934400000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
original split indices are Int64Index([0, 267, 268, 316], dtype='int64')
0 2015-08-06 08:31:14
267 2015-08-06 13:15:15
268 2015-08-06 15:45:06
316 2015-08-06 16:07:41
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-08-06 08:31:14 to 2015-08-06 13:15:15 because start = 0 and end = 267
Considering trip from 2015-08-06 13:15:15 to 2015-08-06 15:45:06 because start = 267 and end = 268
Ignoring trip from 2015-08-06 13:15:15 to 2015-08-06 15:45:06 because start = 267 and end = 268
Considering trip from 2015-08-06 15:45:06 to 2015-08-06 16:07:41 because start = 268 and end = 316
2
final query = {'metadata.key': 'background/location', '$and': [{'data.mTime': {'$gt': 1438848000000.0}}, {'data.mTime': {'$lt': 1438934400000.0}}], 'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), 'metadata.filter': 'time'}
filtering points Int64Index([3, 16, 17, 18, 19, 20, 22, 23, 26, 27, 29, 31, 32, 33, 34, 35, 38, 39, 40, 41, 44, 45, 53, 66, 67, 68, 69, 70, 73, 74, 75, 76, 77, 80, 81, 82, 83, 85, 87, 93, 105, 106, 115, 116, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, ...], dtype='int64')
filtered list size went from (317, 29) to (166, 29)
filtered split indices are Int64Index([0, 139, 172, 186, 203, 267, 268, 305], dtype='int64')
0 2015-08-06 08:31:14
139 2015-08-06 09:45:24
172 2015-08-06 10:02:24
186 2015-08-06 10:09:25
203 2015-08-06 10:18:58
267 2015-08-06 13:15:15
268 2015-08-06 15:45:06
305 2015-08-06 16:03:01
Name: formatted_time, dtype: datetime64[ns]
Considering trip from 2015-08-06 08:31:14 to 2015-08-06 09:45:24 because start = 0 and end = 139
Considering trip from 2015-08-06 09:45:24 to 2015-08-06 10:02:24 because start = 139 and end = 172
Considering trip from 2015-08-06 10:02:24 to 2015-08-06 10:09:25 because start = 172 and end = 186
Considering trip from 2015-08-06 10:09:25 to 2015-08-06 10:18:58 because start = 186 and end = 203
Considering trip from 2015-08-06 10:18:58 to 2015-08-06 13:15:15 because start = 203 and end = 267
Considering trip from 2015-08-06 13:15:15 to 2015-08-06 15:45:06 because start = 267 and end = 268
Ignoring trip from 2015-08-06 13:15:15 to 2015-08-06 15:45:06 because start = 267 and end = 268
Considering trip from 2015-08-06 15:45:06 to 2015-08-06 16:03:01 because start = 268 and end = 305
6
In [45]:
In [45]:
In [45]:
Content source: joshzarrabi/e-mission-server
Similar notebooks: