{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pylab as plt\nimport seaborn as sns","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:35.48891Z","iopub.execute_input":"2022-09-20T13:55:35.489394Z","iopub.status.idle":"2022-09-20T13:55:36.727837Z","shell.execute_reply.started":"2022-09-20T13:55:35.489302Z","shell.execute_reply":"2022-09-20T13:55:36.726637Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_gnss=pd.read_csv('C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022/train/2020-05-15-US-MTV-1/GooglePixel4XL/device_gnss.csv')\ndf_device_gnss.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.729872Z","iopub.execute_input":"2022-09-20T13:55:36.730222Z","iopub.status.idle":"2022-09-20T13:55:36.863133Z","shell.execute_reply.started":"2022-09-20T13:55:36.730189Z","shell.execute_reply":"2022-09-20T13:55:36.856653Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_gnss.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.864794Z","iopub.status.idle":"2022-09-20T13:55:36.866318Z","shell.execute_reply.started":"2022-09-20T13:55:36.866056Z","shell.execute_reply":"2022-09-20T13:55:36.866085Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df_device_gnss)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.868193Z","iopub.status.idle":"2022-09-20T13:55:36.868992Z","shell.execute_reply.started":"2022-09-20T13:55:36.868759Z","shell.execute_reply":"2022-09-20T13:55:36.868789Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_gnss[\"HardwareClockDiscontinuityCount\"].unique()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.870362Z","iopub.status.idle":"2022-09-20T13:55:36.870819Z","shell.execute_reply.started":"2022-09-20T13:55:36.870604Z","shell.execute_reply":"2022-09-20T13:55:36.870624Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_gnss[\"IsrbMeters\"].mean()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.873212Z","iopub.status.idle":"2022-09-20T13:55:36.873902Z","shell.execute_reply.started":"2022-09-20T13:55:36.873681Z","shell.execute_reply":"2022-09-20T13:55:36.873709Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.relplot(x=\"BiasNanos\" , y=\"HardwareClockDiscontinuityCount\" , hue=\"BiasNanos\" , data=df_device_gnss)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.875426Z","iopub.status.idle":"2022-09-20T13:55:36.876505Z","shell.execute_reply.started":"2022-09-20T13:55:36.876165Z","shell.execute_reply":"2022-09-20T13:55:36.876194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_gnss.iloc[:,3:].corr()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.878523Z","iopub.status.idle":"2022-09-20T13:55:36.879445Z","shell.execute_reply.started":"2022-09-20T13:55:36.879128Z","shell.execute_reply":"2022-09-20T13:55:36.879157Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_imu=pd.read_csv('C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022/train/2020-05-15-US-MTV-1/GooglePixel4XL/device_imu.csv')\ndf_device_imu.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.880908Z","iopub.status.idle":"2022-09-20T13:55:36.881657Z","shell.execute_reply.started":"2022-09-20T13:55:36.881352Z","shell.execute_reply":"2022-09-20T13:55:36.881372Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_imu.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.88317Z","iopub.status.idle":"2022-09-20T13:55:36.883686Z","shell.execute_reply.started":"2022-09-20T13:55:36.883449Z","shell.execute_reply":"2022-09-20T13:55:36.883488Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df_device_imu)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.885427Z","iopub.status.idle":"2022-09-20T13:55:36.886047Z","shell.execute_reply.started":"2022-09-20T13:55:36.885752Z","shell.execute_reply":"2022-09-20T13:55:36.88578Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_imu[\"MessageType\"].unique()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.887974Z","iopub.status.idle":"2022-09-20T13:55:36.888655Z","shell.execute_reply.started":"2022-09-20T13:55:36.888405Z","shell.execute_reply":"2022-09-20T13:55:36.888432Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(8, 8))\nplt.rcParams[\"font.size\"] = 20\nplt.bar(\n    df_device_imu[\"MessageType\"].value_counts().sort_values(ascending=False).index,\n    df_device_imu[\"MessageType\"].value_counts().sort_values(ascending=False),\n)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.889881Z","iopub.status.idle":"2022-09-20T13:55:36.890558Z","shell.execute_reply.started":"2022-09-20T13:55:36.890319Z","shell.execute_reply":"2022-09-20T13:55:36.890342Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_imu.iloc[:,3:].corr()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.892106Z","iopub.status.idle":"2022-09-20T13:55:36.89283Z","shell.execute_reply.started":"2022-09-20T13:55:36.892609Z","shell.execute_reply":"2022-09-20T13:55:36.892632Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ground_truth=pd.read_csv('C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022/train/2020-05-15-US-MTV-1/GooglePixel4XL/ground_truth.csv')\ndf_ground_truth.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.894434Z","iopub.status.idle":"2022-09-20T13:55:36.895163Z","shell.execute_reply.started":"2022-09-20T13:55:36.894949Z","shell.execute_reply":"2022-09-20T13:55:36.894975Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ground_truth.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.896658Z","iopub.status.idle":"2022-09-20T13:55:36.897553Z","shell.execute_reply.started":"2022-09-20T13:55:36.897211Z","shell.execute_reply":"2022-09-20T13:55:36.89724Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df_ground_truth)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.898945Z","iopub.status.idle":"2022-09-20T13:55:36.899715Z","shell.execute_reply.started":"2022-09-20T13:55:36.899486Z","shell.execute_reply":"2022-09-20T13:55:36.899515Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import plotly.express as px\nimport glob\nfrom dataclasses import dataclass\nfrom tqdm.notebook import tqdm\nfrom scipy.interpolate import InterpolatedUnivariateSpline\n\npd.set_option(\"max_columns\", 500)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.901323Z","iopub.status.idle":"2022-09-20T13:55:36.902209Z","shell.execute_reply.started":"2022-09-20T13:55:36.901903Z","shell.execute_reply":"2022-09-20T13:55:36.901933Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"INPUT_PATH = \"C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022\"\n\nWGS84_SEMI_MAJOR_AXIS = 6378137.0\nWGS84_SEMI_MINOR_AXIS = 6356752.314245\nWGS84_SQUARED_FIRST_ECCENTRICITY = 6.69437999013e-3\nWGS84_SQUARED_SECOND_ECCENTRICITY = 6.73949674226e-3\n\nHAVERSINE_RADIUS = 6_371_000\n\n\n@dataclass\nclass ECEF:\n    x: np.array\n    y: np.array\n    z: np.array\n\n    def to_numpy(self):\n        return np.stack([self.x, self.y, self.z], axis=0)\n\n    @staticmethod\n    def from_numpy(pos):\n        x, y, z = [np.squeeze(w) for w in np.split(pos, 3, axis=-1)]\n        return ECEF(x=x, y=y, z=z)\n\n\n@dataclass\nclass BLH:\n    lat: np.array\n    lng: np.array\n    hgt: np.array\n\n\ndef ECEF_to_BLH(ecef):\n    a = WGS84_SEMI_MAJOR_AXIS\n    b = WGS84_SEMI_MINOR_AXIS\n    e2 = WGS84_SQUARED_FIRST_ECCENTRICITY\n    e2_ = WGS84_SQUARED_SECOND_ECCENTRICITY\n    x = ecef.x\n    y = ecef.y\n    z = ecef.z\n    r = np.sqrt(x**2 + y**2)\n    t = np.arctan2(z * (a / b), r)\n    B = np.arctan2(z + (e2_ * b) * np.sin(t) ** 3, r - (e2 * a) * np.cos(t) ** 3)\n    L = np.arctan2(y, x)\n    n = a / np.sqrt(1 - e2 * np.sin(B) ** 2)\n    H = (r / np.cos(B)) - n\n    return BLH(lat=B, lng=L, hgt=H)\n\n\ndef haversine_distance(blh_1, blh_2):\n    dlat = blh_2.lat - blh_1.lat\n    dlng = blh_2.lng - blh_1.lng\n    a = (\n        np.sin(dlat / 2) ** 2\n        + np.cos(blh_1.lat) * np.cos(blh_2.lat) * np.sin(dlng / 2) ** 2\n    )\n    dist = 2 * HAVERSINE_RADIUS * np.arcsin(np.sqrt(a))\n    return dist\n\n\ndef pandas_haversine_distance(df1, df2):\n    blh1 = BLH(\n        lat=np.deg2rad(df1[\"LatitudeDegrees\"].to_numpy()),\n        lng=np.deg2rad(df1[\"LongitudeDegrees\"].to_numpy()),\n        hgt=0,\n    )\n    blh2 = BLH(\n        lat=np.deg2rad(df2[\"LatitudeDegrees\"].to_numpy()),\n        lng=np.deg2rad(df2[\"LongitudeDegrees\"].to_numpy()),\n        hgt=0,\n    )\n    return haversine_distance(blh1, blh2)\n\n\ndef ecef_to_lat_lng(tripID, gnss_df, UnixTimeMillis):\n    ecef_columns = [\n        \"WlsPositionXEcefMeters\",\n        \"WlsPositionYEcefMeters\",\n        \"WlsPositionZEcefMeters\",\n    ]\n    columns = [\"utcTimeMillis\"] + ecef_columns\n    ecef_df = (\n        gnss_df.drop_duplicates(subset=\"utcTimeMillis\")[columns]\n        .dropna()\n        .reset_index(drop=True)\n    )\n    ecef = ECEF.from_numpy(ecef_df[ecef_columns].to_numpy())\n    blh = ECEF_to_BLH(ecef)\n\n    TIME = ecef_df[\"utcTimeMillis\"].to_numpy()\n    lat = InterpolatedUnivariateSpline(TIME, blh.lat, ext=3)(UnixTimeMillis)\n    lng = InterpolatedUnivariateSpline(TIME, blh.lng, ext=3)(UnixTimeMillis)\n    return pd.DataFrame(\n        {\n            \"tripId\": tripID,\n            \"UnixTimeMillis\": UnixTimeMillis,\n            \"LatitudeDegrees\": np.degrees(lat),\n            \"LongitudeDegrees\": np.degrees(lng),\n        }\n    )\n\n\ndef calc_score(tripID, pred_df, gt_df):\n    d = pandas_haversine_distance(pred_df, gt_df)\n    score = np.mean([np.quantile(d, 0.50), np.quantile(d, 0.95)])\n    return score\n","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.903756Z","iopub.status.idle":"2022-09-20T13:55:36.904618Z","shell.execute_reply.started":"2022-09-20T13:55:36.904284Z","shell.execute_reply":"2022-09-20T13:55:36.904326Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def visualize_traffic(\n    df,\n    lat_col=\"LatitudeDegrees\",\n    lon_col=\"LongitudeDegrees\",\n    center=None,\n    color_col=\"phone\",\n    label_col=\"tripId\",\n    zoom=9,\n    opacity=1,\n):\n    if center is None:\n        center = {\n            \"lat\": df[lat_col].mean(),\n            \"lon\": df[lon_col].mean(),\n        }\n    fig = px.scatter_mapbox(\n        df,\n        lat=lat_col,\n        lon=lon_col,\n        color=color_col,\n        labels=label_col,\n        zoom=zoom,\n        center=center,\n        height=600,\n        width=800,\n        opacity=0.5,\n    )\n    fig.update_layout(mapbox_style=\"stamen-terrain\")\n    fig.update_layout(margin={\"r\": 0, \"t\": 0, \"l\": 0, \"b\": 0})\n    fig.update_layout(title_text=\"GPS trafic\")\n    fig.show()\n\n    \ndef plot_gt_vs_baseline(tripId):\n    \"\"\"\n    Create a plot of the baseline predictions vs. the ground truth\n    for a given tripId\n    \"\"\"\n    # Pull Data for an example phone\n    gt = pd.read_csv(\n        f\"C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022/train/{tripId}/ground_truth.csv\"\n    )\n    gnss = pd.read_csv(\n        f\"C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022/train/{tripId}/device_gnss.csv\"\n    )\n    imu = pd.read_csv(\n        f\"C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022/train/{tripId}/device_imu.csv\"\n    )\n    baseline = ecef_to_lat_lng(trip_id, gnss, gt[\"UnixTimeMillis\"].values)\n    # Combine ground truth with baseline predictions\n    baseline[\"isGT\"] = False\n    gt[\"isGT\"] = True\n    gt[\"tripId\"] = tripId\n\n    combined = (\n        pd.concat([baseline, gt[baseline.columns]], axis=0)\n        .reset_index(drop=True)\n        .copy()\n    )\n\n    # Plotting the route\n    visualize_traffic(\n        combined,\n        lat_col=\"LatitudeDegrees\",\n        lon_col=\"LongitudeDegrees\",\n        color_col=\"isGT\",\n        zoom=10,\n    )\n","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.906086Z","iopub.status.idle":"2022-09-20T13:55:36.906839Z","shell.execute_reply.started":"2022-09-20T13:55:36.906535Z","shell.execute_reply":"2022-09-20T13:55:36.906574Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trip_id = \"2020-05-15-US-MTV-1/GooglePixel4XL\"\nplot_gt_vs_baseline(trip_id)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.908398Z","iopub.status.idle":"2022-09-20T13:55:36.909208Z","shell.execute_reply.started":"2022-09-20T13:55:36.908951Z","shell.execute_reply":"2022-09-20T13:55:36.908984Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trip_id2 = \"2020-05-21-US-MTV-1/GooglePixel4\"\nplot_gt_vs_baseline(trip_id2)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.910634Z","iopub.status.idle":"2022-09-20T13:55:36.911359Z","shell.execute_reply.started":"2022-09-20T13:55:36.911059Z","shell.execute_reply":"2022-09-20T13:55:36.911089Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trip_id3 = \"2020-08-06-US-MTV-1/GooglePixel4\"\nplot_gt_vs_baseline(trip_id3)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.912612Z","iopub.status.idle":"2022-09-20T13:55:36.913663Z","shell.execute_reply.started":"2022-09-20T13:55:36.913336Z","shell.execute_reply":"2022-09-20T13:55:36.913363Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Metadata","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.915837Z","iopub.status.idle":"2022-09-20T13:55:36.916267Z","shell.execute_reply.started":"2022-09-20T13:55:36.91607Z","shell.execute_reply":"2022-09-20T13:55:36.91609Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_meta = pd.read_csv(\n    \"C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022/metadata/constellation_type_mapping.csv\"\n)\ndf_meta","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.920117Z","iopub.status.idle":"2022-09-20T13:55:36.920997Z","shell.execute_reply.started":"2022-09-20T13:55:36.920687Z","shell.execute_reply":"2022-09-20T13:55:36.920716Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#test","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.922062Z","iopub.status.idle":"2022-09-20T13:55:36.923134Z","shell.execute_reply.started":"2022-09-20T13:55:36.922838Z","shell.execute_reply":"2022-09-20T13:55:36.922869Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test_gnss = pd.read_csv(\n    \"C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022/test/2021-04-28-US-MTV-2/SamsungGalaxyS20Ultra/device_gnss.csv\"\n)\ndf_test_gnss.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.924881Z","iopub.status.idle":"2022-09-20T13:55:36.925763Z","shell.execute_reply.started":"2022-09-20T13:55:36.92542Z","shell.execute_reply":"2022-09-20T13:55:36.925449Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df_test_gnss)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.927812Z","iopub.status.idle":"2022-09-20T13:55:36.92824Z","shell.execute_reply.started":"2022-09-20T13:55:36.928041Z","shell.execute_reply":"2022-09-20T13:55:36.928064Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test_gnss[\"CodeType\"].value_counts()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.930337Z","iopub.status.idle":"2022-09-20T13:55:36.93096Z","shell.execute_reply.started":"2022-09-20T13:55:36.930639Z","shell.execute_reply":"2022-09-20T13:55:36.930667Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test_imu = pd.read_csv(\n    \"C:/Users/kvenkatesh3/Downloads/Kaggle DS/smartphone-decimeter-2022/test/2021-04-28-US-MTV-2/SamsungGalaxyS20Ultra/device_imu.csv\"\n)\ndf_test_imu.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.932947Z","iopub.status.idle":"2022-09-20T13:55:36.93353Z","shell.execute_reply.started":"2022-09-20T13:55:36.933215Z","shell.execute_reply":"2022-09-20T13:55:36.933239Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df_test_imu)","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.935188Z","iopub.status.idle":"2022-09-20T13:55:36.935828Z","shell.execute_reply.started":"2022-09-20T13:55:36.935547Z","shell.execute_reply":"2022-09-20T13:55:36.935575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test_imu.iloc[:,3:].corr()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.937157Z","iopub.status.idle":"2022-09-20T13:55:36.937632Z","shell.execute_reply.started":"2022-09-20T13:55:36.937395Z","shell.execute_reply":"2022-09-20T13:55:36.937416Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=[15,7])\n\n# ax, fig = plt.subplots(figsize=[15,7])\nsns.boxplot(x=\"MessageType\", y=\"utcTimeMillis\",data=df_test_gnss)\nplt.ylabel(\"Dist (m)\") # distance in meters\nplt.ylim([0,30]) # for better visualization","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.938957Z","iopub.status.idle":"2022-09-20T13:55:36.93944Z","shell.execute_reply.started":"2022-09-20T13:55:36.939222Z","shell.execute_reply":"2022-09-20T13:55:36.939242Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_gnss.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.941872Z","iopub.status.idle":"2022-09-20T13:55:36.942514Z","shell.execute_reply.started":"2022-09-20T13:55:36.942149Z","shell.execute_reply":"2022-09-20T13:55:36.942175Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_imu.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.944356Z","iopub.status.idle":"2022-09-20T13:55:36.944958Z","shell.execute_reply.started":"2022-09-20T13:55:36.944651Z","shell.execute_reply":"2022-09-20T13:55:36.944679Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_gnss.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.946193Z","iopub.status.idle":"2022-09-20T13:55:36.946751Z","shell.execute_reply.started":"2022-09-20T13:55:36.946454Z","shell.execute_reply":"2022-09-20T13:55:36.946499Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_imu.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.948732Z","iopub.status.idle":"2022-09-20T13:55:36.949568Z","shell.execute_reply.started":"2022-09-20T13:55:36.949229Z","shell.execute_reply":"2022-09-20T13:55:36.949258Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"gnss_time= list(set(df_device_gnss['utcTimeMillis']))","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.952023Z","iopub.status.idle":"2022-09-20T13:55:36.952597Z","shell.execute_reply.started":"2022-09-20T13:55:36.95229Z","shell.execute_reply":"2022-09-20T13:55:36.952325Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_device_imu[df_device_imu['utcTimeMillis'].isin(gnss_time)]","metadata":{"execution":{"iopub.status.busy":"2022-09-20T13:55:36.95477Z","iopub.status.idle":"2022-09-20T13:55:36.955316Z","shell.execute_reply.started":"2022-09-20T13:55:36.955043Z","shell.execute_reply":"2022-09-20T13:55:36.955068Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}