-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
It looks like we have some duplicate entries in the error_df
total number of entries is 463, duplicate entries are 460
so this line fails because to_records(orient='index') fails if there are duplicate indices
DataFrame index must be unique for orient='index'.
ezgj.get_fg_for_loc_df(error_df, name="sensed_points", color="red", popupfn=name_err_time, stickyfn=gt_16k).add_to(curr_map)
This is part of
gt_leg = sd_ucb.get_ground_truth_for_leg("mtv_to_berkeley_sf_bart", "walk_to_bus",
sd_ucb.curr_spec_wrapper["start_ts"], sd_ucb.curr_spec_wrapper["end_ts"]);
print(gt_leg["id"])
curr_map = ezgj.get_map_for_geojson(sd_ucb.get_geojson_for_leg(gt_leg), name="ground_truth")
ezgj.get_fg_for_loc_df(emd.linestring_to_geo_df(eisd.SpecDetails.get_shapes_for_leg(gt_leg)["route"]),
name="gt_points", color="green").add_to(curr_map)
name_err_time = lambda lr: "%d: %d, %s, %s" % (lr["index"], lr["df_idx"], lr["error"], sd_ucb.fmt(lr["ts"], "MM-DD HH:mm:ss"))
error_df = emd.to_loc_df(spatial_errors_df.query("trip_id == 'mtv_to_berkeley_sf_bart' & phone_os == 'android' & quality == 3 & section_id == 'walk_to_bus'").sort_index(axis="index"))
maxes = [error_df.error.max(), error_df[error_df.error < 16000].error.max(), error_df[error_df.error < 5000].error.max()]
gt_16k = lambda lr: lr["error"] in maxes
print("Checking errors %s" % maxes)
folium.GeoJson(ezgj.get_geojson_for_loc_df(error_df, color="red"), name="sensed_values").add_to(curr_map)
# It looks like we have some duplicate entries in the error_df
# total number of entries is 463, duplicate entries are 460
# so this line fails because `to_records(orient='index')` fails if there are duplicate indices
# `DataFrame index must be unique for orient='index'.`
# Let's comment this out for now and fix later
# ezgj.get_fg_for_loc_df(error_df, name="sensed_points", color="red", popupfn=name_err_time, stickyfn=gt_16k).add_to(curr_map)
folium.LayerControl().add_to(curr_map)
curr_map
No time to investigate this now, but recording it for investigation/fixing later.
Metadata
Metadata
Assignees
Labels
No labels