{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-10-30T22:02:48.756931Z","iopub.execute_input":"2023-10-30T22:02:48.757654Z","iopub.status.idle":"2023-10-30T22:02:49.078834Z","shell.execute_reply.started":"2023-10-30T22:02:48.757613Z","shell.execute_reply":"2023-10-30T22:02:49.077659Z"},"trusted":true},"execution_count":1,"outputs":[{"name":"stdout","text":"/kaggle/input/child-mind-institute-detect-sleep-states/train_series.parquet\n/kaggle/input/child-mind-institute-detect-sleep-states/sample_submission.csv\n/kaggle/input/child-mind-institute-detect-sleep-states/train_events.csv\n/kaggle/input/child-mind-institute-detect-sleep-states/test_series.parquet\n","output_type":"stream"}]},{"cell_type":"code","source":"import os\nimport re\nimport gc\nimport wandb\nimport random\nimport math\nfrom glob import glob\nfrom tqdm import tqdm\nfrom time import time\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport warnings\nimport pandas as pd\nimport numpy as np\n","metadata":{"execution":{"iopub.status.busy":"2023-10-30T22:10:54.504899Z","iopub.execute_input":"2023-10-30T22:10:54.505266Z","iopub.status.idle":"2023-10-30T22:10:54.511424Z","shell.execute_reply.started":"2023-10-30T22:10:54.505238Z","shell.execute_reply":"2023-10-30T22:10:54.510195Z"},"trusted":true},"execution_count":6,"outputs":[]},{"cell_type":"code","source":"train_events = pd.read_csv('/kaggle/input/child-mind-institute-detect-sleep-states/train_events.csv')","metadata":{"execution":{"iopub.status.busy":"2023-10-30T22:11:23.041898Z","iopub.execute_input":"2023-10-30T22:11:23.042292Z","iopub.status.idle":"2023-10-30T22:11:23.085934Z","shell.execute_reply.started":"2023-10-30T22:11:23.042264Z","shell.execute_reply":"2023-10-30T22:11:23.084455Z"},"trusted":true},"execution_count":7,"outputs":[]},{"cell_type":"code","source":"train_events.memory_usage(deep=True)","metadata":{"execution":{"iopub.status.busy":"2023-10-30T22:11:58.674897Z","iopub.execute_input":"2023-10-30T22:11:58.675269Z","iopub.status.idle":"2023-10-30T22:11:58.692894Z","shell.execute_reply.started":"2023-10-30T22:11:58.675241Z","shell.execute_reply":"2023-10-30T22:11:58.690914Z"},"trusted":true},"execution_count":9,"outputs":[{"execution_count":9,"output_type":"execute_result","data":{"text/plain":"Index            128\nseries_id    1001052\nnight         116064\nevent         906750\nstep          116064\ntimestamp     933921\ndtype: int64"},"metadata":{}}]},{"cell_type":"code","source":"train_events.memory_usage(deep=True).sum() / (1024*1024)","metadata":{"execution":{"iopub.status.busy":"2023-10-30T22:12:34.016572Z","iopub.execute_input":"2023-10-30T22:12:34.016963Z","iopub.status.idle":"2023-10-30T22:12:34.031033Z","shell.execute_reply.started":"2023-10-30T22:12:34.016933Z","shell.execute_reply":"2023-10-30T22:12:34.029735Z"},"trusted":true},"execution_count":10,"outputs":[{"execution_count":10,"output_type":"execute_result","data":{"text/plain":"2.931574821472168"},"metadata":{}}]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}