{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":81933,"databundleVersionId":9643020,"sourceType":"competition"}],"dockerImageVersionId":30775,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nimport pandas as pd \nimport polars as pl\nimport os\nimport matplotlib.pyplot as plt","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-10-05T18:05:10.445134Z","iopub.execute_input":"2024-10-05T18:05:10.445927Z","iopub.status.idle":"2024-10-05T18:05:12.135452Z","shell.execute_reply.started":"2024-10-05T18:05:10.445881Z","shell.execute_reply":"2024-10-05T18:05:12.134256Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_dir = \"/kaggle/input/child-mind-institute-problematic-internet-use/series_train.parquet/\"\ntest_dir = \"/kaggle/input/child-mind-institute-problematic-internet-use/series_test.parquet/\"","metadata":{"execution":{"iopub.status.busy":"2024-10-05T18:05:12.137556Z","iopub.execute_input":"2024-10-05T18:05:12.138154Z","iopub.status.idle":"2024-10-05T18:05:12.143599Z","shell.execute_reply.started":"2024-10-05T18:05:12.138104Z","shell.execute_reply":"2024-10-05T18:05:12.142167Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def read_file(path) -> pd.DataFrame: \n    df = pl.read_parquet(path)\n    return df","metadata":{"execution":{"iopub.status.busy":"2024-10-05T18:05:12.144855Z","iopub.execute_input":"2024-10-05T18:05:12.145185Z","iopub.status.idle":"2024-10-05T18:05:12.154069Z","shell.execute_reply.started":"2024-10-05T18:05:12.145151Z","shell.execute_reply":"2024-10-05T18:05:12.152907Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def load_time_series(dir_path: str) -> pd.DataFrame:\n    time_series_store = {}\n    file_ind = os.listdir(dir_path)\n    for file_name in file_ind:\n        file_path = os.path.join(dir_path + file_name, 'part-0.parquet')\n        df = read_file(file_path)\n        time_series_store[file_name] = df\n    return time_series_store","metadata":{"execution":{"iopub.status.busy":"2024-10-05T18:05:12.156565Z","iopub.execute_input":"2024-10-05T18:05:12.157002Z","iopub.status.idle":"2024-10-05T18:05:12.166147Z","shell.execute_reply.started":"2024-10-05T18:05:12.156955Z","shell.execute_reply":"2024-10-05T18:05:12.165177Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"time_series_store = load_time_series(train_dir)","metadata":{"execution":{"iopub.status.busy":"2024-10-05T18:05:12.167645Z","iopub.execute_input":"2024-10-05T18:05:12.168110Z","iopub.status.idle":"2024-10-05T18:06:01.097600Z","shell.execute_reply.started":"2024-10-05T18:05:12.168062Z","shell.execute_reply":"2024-10-05T18:06:01.093181Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"list(time_series_store.values())[:3]\nlist(time_series_store.items())[:3]","metadata":{"execution":{"iopub.status.busy":"2024-10-05T18:07:52.219064Z","iopub.execute_input":"2024-10-05T18:07:52.219858Z","iopub.status.idle":"2024-10-05T18:07:52.256260Z","shell.execute_reply.started":"2024-10-05T18:07:52.219807Z","shell.execute_reply":"2024-10-05T18:07:52.255155Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Plotting Full Time Series  <a class=\"anchor\"  id=\"chapter1\"></a>","metadata":{}},{"cell_type":"code","source":"def plot_xyz(key: str):\n    \n    df = time_series_store[key]\n    X, Y, Z = df['X'], df['Y'], df['Z']\n    \n    plt.subplots(3, 1, sharex='col', sharey='row', figsize=(12,6))\n    plt.subplot(3, 1, 1)\n    plt.plot(X, color='#69cf83', label='X')\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (X)')\n    plt.legend()\n\n    plt.subplot(3, 1, 2)\n    plt.plot(Y, color='#d6b258', label='Y')\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (Y)')\n    plt.legend()\n\n    plt.subplot(3, 1, 3)\n    plt.plot(Z, color='#96bcfa', label='Z')\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (Z)')\n    plt.legend()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:41:18.039636Z","iopub.execute_input":"2024-10-05T19:41:18.040608Z","iopub.status.idle":"2024-10-05T19:41:18.050148Z","shell.execute_reply.started":"2024-10-05T19:41:18.040562Z","shell.execute_reply":"2024-10-05T19:41:18.048716Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"list(time_series_store.keys())[:3]","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:41:20.769583Z","iopub.execute_input":"2024-10-05T19:41:20.769984Z","iopub.status.idle":"2024-10-05T19:41:20.778287Z","shell.execute_reply.started":"2024-10-05T19:41:20.769946Z","shell.execute_reply":"2024-10-05T19:41:20.777137Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for ind_key in list(time_series_store.keys())[:3]:\n    print(ind_key)\n    plot_xyz(ind_key)","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:41:44.014680Z","iopub.execute_input":"2024-10-05T19:41:44.015654Z","iopub.status.idle":"2024-10-05T19:41:47.301287Z","shell.execute_reply.started":"2024-10-05T19:41:44.015605Z","shell.execute_reply":"2024-10-05T19:41:47.299917Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Plotting Time Series with Delta","metadata":{}},{"cell_type":"code","source":"def plot_xyz(key: str):\n    \n    df = time_series_store[key]\n    X, Y, Z = df['X'], df['Y'], df['Z']\n    \n    fig, axs = plt.subplots(3, 2, figsize=(12, 12))\n    \n    axs[0, 0].plot(X, color='#69cf83', label='X')\n    axs[0, 0].set_xlabel('Time')\n    axs[0, 0].set_ylabel('Sensor Value (X)')\n    axs[0, 0].legend()\n    \n    axs[0, 1].plot(X.diff(), color='#2d8e46', linestyle='dashed', label='ΔX', alpha=0.5)\n    axs[0, 1].set_xlabel('Time')\n    axs[0, 1].set_ylabel('ΔX Value')\n    axs[0, 1].legend()\n\n    axs[1, 0].plot(Y, color='#d6b258', label='Y')\n    axs[1, 0].set_xlabel('Time')\n    axs[1, 0].set_ylabel('Sensor Value (Y)')\n    axs[1, 0].legend()\n    \n    axs[1, 1].plot(Y.diff(), color='#917224', linestyle='dashed', label='ΔY', alpha=0.5)\n    axs[1, 1].set_xlabel('Time')\n    axs[1, 1].set_ylabel('ΔY Value')\n    axs[1, 1].legend()\n\n    axs[2, 0].plot(Z, color='#96bcfa', label='Z')\n    axs[2, 0].set_xlabel('Time')\n    axs[2, 0].set_ylabel('Sensor Value (Z)')\n    axs[2, 0].legend()\n    \n    axs[2, 1].plot(Z.diff(), color='#0b5ee5', linestyle='dashed', label='ΔZ', alpha=0.5)\n    axs[2, 1].set_xlabel('Time')\n    axs[2, 1].set_ylabel('ΔZ Value')\n    axs[2, 1].legend()\n\n    plt.tight_layout()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-05T18:39:03.334401Z","iopub.execute_input":"2024-10-05T18:39:03.335479Z","iopub.status.idle":"2024-10-05T18:39:03.352133Z","shell.execute_reply.started":"2024-10-05T18:39:03.335406Z","shell.execute_reply":"2024-10-05T18:39:03.351083Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for ind_key in list(time_series_store.keys())[:3]:\n    print(ind_key)\n    plot_xyz(ind_key)","metadata":{"execution":{"iopub.status.busy":"2024-10-05T18:39:07.126165Z","iopub.execute_input":"2024-10-05T18:39:07.126597Z","iopub.status.idle":"2024-10-05T18:39:14.617566Z","shell.execute_reply.started":"2024-10-05T18:39:07.126557Z","shell.execute_reply":"2024-10-05T18:39:14.616545Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Time Series With enmo","metadata":{}},{"cell_type":"markdown","source":"enmo - Euclidean Norm Minus One of all accelerometer signals (along each of the x-, y-, and z-axis, measured in g-force) with negative values rounded to zero. Zero values are indicative of periods of no motion.","metadata":{}},{"cell_type":"code","source":"def plot_xyz(key: str):\n    \n    df = time_series_store[key]\n    X, Y, Z = df['X'], df['Y'], df['Z']\n    E = df['enmo']\n    \n    plt.subplots(3, 1, sharex='col', sharey='row', figsize=(12,6))\n    plt.subplot(3, 1, 1)\n    plt.plot(X, color='#69cf83', label='X')\n    plt.plot(E, color='#000000', linestyle='dashed', label='E', alpha=0.5)\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (X)')\n    plt.legend()\n\n    plt.subplot(3, 1, 2)\n    plt.plot(Y, color='#d6b258', label='Y')\n    plt.plot(E, color='#000000', linestyle='dashed', label='E', alpha=0.5)\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (Y)')\n    plt.legend()\n\n    plt.subplot(3, 1, 3)\n    plt.plot(Z, color='#96bcfa', label='Z')\n    plt.plot(E, color='#000000', linestyle='dashed', label='E', alpha=0.5)\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (Z)')\n    plt.legend()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:07:04.813443Z","iopub.execute_input":"2024-10-05T19:07:04.814404Z","iopub.status.idle":"2024-10-05T19:07:04.824688Z","shell.execute_reply.started":"2024-10-05T19:07:04.814357Z","shell.execute_reply":"2024-10-05T19:07:04.823435Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for ind_key in list(time_series_store.keys())[:3]:\n    print(ind_key)\n    plot_xyz(ind_key)","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:07:07.097994Z","iopub.execute_input":"2024-10-05T19:07:07.098371Z","iopub.status.idle":"2024-10-05T19:07:13.426404Z","shell.execute_reply.started":"2024-10-05T19:07:07.098337Z","shell.execute_reply":"2024-10-05T19:07:13.425373Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Time Series Delta With Enmo Delta","metadata":{}},{"cell_type":"code","source":"def plot_xyz(key: str):\n    \n    df = time_series_store[key]\n    X, Y, Z = df['X'], df['Y'], df['Z']\n    E = df['enmo']\n    \n    plt.subplots(3, 1, sharex='col', sharey='row', figsize=(12,6))\n    plt.subplot(3, 1, 1)\n    plt.plot(X.diff(), color='#69cf83', label='X')\n    plt.plot(E.diff(), color='#000000', linestyle='dashed', label='E', alpha=0.5)\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (X)')\n    plt.legend()\n\n    plt.subplot(3, 1, 2)\n    plt.plot(Y.diff(), color='#d6b258', label='Y')\n    plt.plot(E.diff(), color='#000000', linestyle='dashed', label='E', alpha=0.5)\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (Y)')\n    plt.legend()\n\n    plt.subplot(3, 1, 3)\n    plt.plot(Z.diff(), color='#96bcfa', label='Z')\n    plt.plot(E.diff(), color='#000000', linestyle='dashed', label='E', alpha=0.5)\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (Z)')\n    plt.legend()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:07:45.720999Z","iopub.execute_input":"2024-10-05T19:07:45.721452Z","iopub.status.idle":"2024-10-05T19:07:45.732704Z","shell.execute_reply.started":"2024-10-05T19:07:45.721391Z","shell.execute_reply":"2024-10-05T19:07:45.731503Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for ind_key in list(time_series_store.keys())[:3]:\n    print(ind_key)\n    plot_xyz(ind_key)","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:08:00.574244Z","iopub.execute_input":"2024-10-05T19:08:00.574679Z","iopub.status.idle":"2024-10-05T19:08:12.473354Z","shell.execute_reply.started":"2024-10-05T19:08:00.574637Z","shell.execute_reply":"2024-10-05T19:08:12.472212Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Plotting Time Series with anglez","metadata":{}},{"cell_type":"markdown","source":"anglez - refers to the angle of the arm relative to the horizontal plane","metadata":{}},{"cell_type":"code","source":"def plot_xyz(key: str):\n    \n    df = time_series_store[key]\n    X, Y, Z = df['X'], df['Y'], df['Z']\n    A = df['anglez']\n    \n    fig, ax1 = plt.subplots(3, 1, sharex='col', figsize=(12, 6))\n    \n    ax1[0].plot(X, color='#69cf83', label='X')\n    ax1[0].set_ylabel('Sensor Value (X)')\n    ax1[0].set_xlabel('Time')\n    ax1[0].legend(loc='upper left')\n    ax1_0 = ax1[0].twinx()  \n    ax1_0.plot(A, color='#000000', linestyle='dashed', label='L', alpha=0.3)\n    ax1_0.set_ylabel('Anglez Value (A)')\n    ax1_0.legend(loc='upper right')\n    \n    ax1[1].plot(Y, color='#d6b258', label='Y')\n    ax1[1].set_ylabel('Sensor Value (Y)')\n    ax1[1].set_xlabel('Time')\n    ax1[1].legend(loc='upper left')\n    ax1_1 = ax1[1].twinx()  \n    ax1_1.plot(A, color='#000000', linestyle='dashed', label='A', alpha=0.3)\n    ax1_1.set_ylabel('Anglez Value (A)')\n    ax1_1.legend(loc='upper right')\n    \n    ax1[2].plot(Z, color='#96bcfa', label='Z')\n    ax1[2].set_ylabel('Sensor Value (Z)')\n    ax1[2].set_xlabel('Time')\n    ax1[2].legend(loc='upper left')\n    ax1_2 = ax1[2].twinx()\n    ax1_2.plot(A, color='#000000', linestyle='dashed', label='A', alpha=0.3)\n    ax1_2.set_ylabel('Anglez Value (A)')\n    ax1_2.legend(loc='upper right')\n    \n    plt.tight_layout()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:03:19.260778Z","iopub.execute_input":"2024-10-05T19:03:19.261210Z","iopub.status.idle":"2024-10-05T19:03:19.272974Z","shell.execute_reply.started":"2024-10-05T19:03:19.261171Z","shell.execute_reply":"2024-10-05T19:03:19.271718Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for ind_key in list(time_series_store.keys())[:3]:\n    print(ind_key)\n    plot_xyz(ind_key)","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:03:22.649526Z","iopub.execute_input":"2024-10-05T19:03:22.649941Z","iopub.status.idle":"2024-10-05T19:03:27.133545Z","shell.execute_reply.started":"2024-10-05T19:03:22.649902Z","shell.execute_reply":"2024-10-05T19:03:27.132475Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Non Wear Flag","metadata":{}},{"cell_type":"code","source":"def plot_xyz(key: str):\n    \n    df = time_series_store[key]\n    X, Y, Z = df['X'], df['Y'], df['Z']\n    W = df['non-wear_flag']\n    \n    plt.subplots(3, 1, sharex='col', sharey='row', figsize=(12,6))\n    plt.subplot(3, 1, 1)\n    plt.plot(X, color='#69cf83', label='X')\n    plt.plot(W, color='#000000', linestyle='dashed', label='W', alpha=0.5)\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (X)')\n    plt.legend()\n\n    plt.subplot(3, 1, 2)\n    plt.plot(Y, color='#d6b258', label='Y')\n    plt.plot(W, color='#000000', linestyle='dashed', label='W', alpha=0.5)\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (Y)')\n    plt.legend()\n\n    plt.subplot(3, 1, 3)\n    plt.plot(Z, color='#96bcfa', label='Z')\n    plt.plot(W, color='#000000', linestyle='dashed', label='W', alpha=0.5)\n    plt.xlabel('Time')\n    plt.ylabel('Sensor Value (Z)')\n    plt.legend()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:10:42.486876Z","iopub.execute_input":"2024-10-05T19:10:42.487326Z","iopub.status.idle":"2024-10-05T19:10:42.499592Z","shell.execute_reply.started":"2024-10-05T19:10:42.487287Z","shell.execute_reply":"2024-10-05T19:10:42.498399Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for ind_key in list(time_series_store.keys())[:3]:\n    print(ind_key)\n    plot_xyz(ind_key)","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:10:45.140836Z","iopub.execute_input":"2024-10-05T19:10:45.141290Z","iopub.status.idle":"2024-10-05T19:10:55.104920Z","shell.execute_reply.started":"2024-10-05T19:10:45.141253Z","shell.execute_reply":"2024-10-05T19:10:55.103758Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Plotting Time Series with light","metadata":{}},{"cell_type":"markdown","source":"light - measure of ambient light in lux.","metadata":{}},{"cell_type":"code","source":"def plot_xyz(key: str):\n    \n    df = time_series_store[key]\n    X, Y, Z = df['X'], df['Y'], df['Z']\n    L = df['light']\n    \n    fig, ax1 = plt.subplots(3, 1, sharex='col', figsize=(12, 6))\n    \n    ax1[0].plot(X, color='#69cf83', label='X')\n    ax1[0].set_ylabel('Sensor Value (X)')\n    ax1[0].set_xlabel('Time')\n    ax1[0].legend(loc='upper left')\n    ax1_0 = ax1[0].twinx()  \n    ax1_0.plot(L, color='#000000', linestyle='dashed', label='L', alpha=0.5)\n    ax1_0.set_ylabel('Light Value (L)')\n    ax1_0.legend(loc='upper right')\n    \n    ax1[1].plot(Y, color='#d6b258', label='Y')\n    ax1[1].set_ylabel('Sensor Value (Y)')\n    ax1[1].set_xlabel('Time')\n    ax1[1].legend(loc='upper left')\n    ax1_1 = ax1[1].twinx()  \n    ax1_1.plot(L, color='#000000', linestyle='dashed', label='L', alpha=0.5)\n    ax1_1.set_ylabel('Light Value (L)')\n    ax1_1.legend(loc='upper right')\n    \n    ax1[2].plot(Z, color='#96bcfa', label='Z')\n    ax1[2].set_ylabel('Sensor Value (Z)')\n    ax1[2].set_xlabel('Time')\n    ax1[2].legend(loc='upper left')\n    ax1_2 = ax1[2].twinx()\n    ax1_2.plot(L, color='#000000', linestyle='dashed', label='L', alpha=0.5)\n    ax1_2.set_ylabel('Light Value (L)')\n    ax1_2.legend(loc='upper right')\n    \n    plt.tight_layout()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:11:11.962659Z","iopub.execute_input":"2024-10-05T19:11:11.963374Z","iopub.status.idle":"2024-10-05T19:11:11.974767Z","shell.execute_reply.started":"2024-10-05T19:11:11.963333Z","shell.execute_reply":"2024-10-05T19:11:11.973508Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for ind_key in list(time_series_store.keys())[:3]:\n    print(ind_key)\n    plot_xyz(ind_key)","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:11:15.247333Z","iopub.execute_input":"2024-10-05T19:11:15.247790Z","iopub.status.idle":"2024-10-05T19:11:19.695903Z","shell.execute_reply.started":"2024-10-05T19:11:15.247750Z","shell.execute_reply":"2024-10-05T19:11:19.694746Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Plotting Time Series Delta with light Delta","metadata":{}},{"cell_type":"code","source":"def plot_xyz(key: str):\n    \n    df = time_series_store[key]\n    X, Y, Z = df['X'], df['Y'], df['Z']\n    L = df['light']\n    \n    fig, ax1 = plt.subplots(3, 1, sharex='col', figsize=(12, 6))\n    \n    ax1[0].plot(X.diff(), color='#69cf83', label='X')\n    ax1[0].set_ylabel('Sensor Value (X)')\n    ax1[0].set_xlabel('Time')\n    ax1[0].legend(loc='upper left')\n    ax1_0 = ax1[0].twinx()  \n    ax1_0.plot(L.diff(), color='#000000', linestyle='dashed', label='L', alpha=0.5)\n    ax1_0.set_ylabel('Light Value (L)')\n    ax1_0.legend(loc='upper right')\n    \n    ax1[1].plot(Y.diff(), color='#d6b258', label='Y')\n    ax1[1].set_ylabel('Sensor Value (Y)')\n    ax1[1].set_xlabel('Time')\n    ax1[1].legend(loc='upper left')\n    ax1_1 = ax1[1].twinx()  \n    ax1_1.plot(L.diff(), color='#000000', linestyle='dashed', label='L', alpha=0.5)\n    ax1_1.set_ylabel('Light Value (L)')\n    ax1_1.legend(loc='upper right')\n    \n    ax1[2].plot(Z.diff(), color='#96bcfa', label='Z')\n    ax1[2].set_ylabel('Sensor Value (Z)')\n    ax1[2].set_xlabel('Time')\n    ax1[2].legend(loc='upper left')\n    ax1_2 = ax1[2].twinx()\n    ax1_2.plot(L.diff(), color='#000000', linestyle='dashed', label='L', alpha=0.5)\n    ax1_2.set_ylabel('Light Value (L)')\n    ax1_2.legend(loc='upper right')\n    \n    plt.tight_layout()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:13:13.651927Z","iopub.execute_input":"2024-10-05T19:13:13.652349Z","iopub.status.idle":"2024-10-05T19:13:13.664984Z","shell.execute_reply.started":"2024-10-05T19:13:13.652311Z","shell.execute_reply":"2024-10-05T19:13:13.663694Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for ind_key in list(time_series_store.keys())[:3]:\n    print(ind_key)\n    plot_xyz(ind_key)","metadata":{"execution":{"iopub.status.busy":"2024-10-05T19:13:24.737218Z","iopub.execute_input":"2024-10-05T19:13:24.738262Z","iopub.status.idle":"2024-10-05T19:13:29.333151Z","shell.execute_reply.started":"2024-10-05T19:13:24.738221Z","shell.execute_reply":"2024-10-05T19:13:29.331957Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}