{"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":"import pandas as pd\npd.options.display.max_columns=1000\npd.options.display.max_rows=1000\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport plotly.express as px","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-09-09T18:36:08.493549Z","iopub.execute_input":"2023-09-09T18:36:08.494163Z","iopub.status.idle":"2023-09-09T18:36:11.189432Z","shell.execute_reply.started":"2023-09-09T18:36:08.494133Z","shell.execute_reply":"2023-09-09T18:36:11.188662Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_parquet('/kaggle/input/child-mind-institute-detect-sleep-states/train_series.parquet')","metadata":{"execution":{"iopub.status.busy":"2023-09-09T18:36:11.190930Z","iopub.execute_input":"2023-09-09T18:36:11.191536Z","iopub.status.idle":"2023-09-09T18:37:02.681141Z","shell.execute_reply.started":"2023-09-09T18:36:11.191510Z","shell.execute_reply":"2023-09-09T18:37:02.679991Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"MAX_SERIES = 35","metadata":{"execution":{"iopub.status.busy":"2023-09-09T18:37:02.682406Z","iopub.execute_input":"2023-09-09T18:37:02.682822Z","iopub.status.idle":"2023-09-09T18:37:02.687995Z","shell.execute_reply.started":"2023-09-09T18:37:02.682789Z","shell.execute_reply":"2023-09-09T18:37:02.686941Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"indexs = train['series_id'].value_counts(ascending=True).head(MAX_SERIES).index\n\ntrain = train[train['series_id'].isin(indexs)]","metadata":{"execution":{"iopub.status.busy":"2023-09-09T18:37:02.689482Z","iopub.execute_input":"2023-09-09T18:37:02.689804Z","iopub.status.idle":"2023-09-09T18:37:12.942363Z","shell.execute_reply.started":"2023-09-09T18:37:02.689779Z","shell.execute_reply":"2023-09-09T18:37:12.940971Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[\"timestamp\"] = pd.to_datetime(train[\"timestamp\"],utc=True)","metadata":{"execution":{"iopub.status.busy":"2023-09-09T18:37:12.944025Z","iopub.execute_input":"2023-09-09T18:37:12.944373Z","iopub.status.idle":"2023-09-09T18:37:51.461468Z","shell.execute_reply.started":"2023-09-09T18:37:12.944341Z","shell.execute_reply":"2023-09-09T18:37:51.460412Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train","metadata":{"execution":{"iopub.status.busy":"2023-09-09T18:37:51.463070Z","iopub.execute_input":"2023-09-09T18:37:51.463331Z","iopub.status.idle":"2023-09-09T18:37:51.483603Z","shell.execute_reply.started":"2023-09-09T18:37:51.463309Z","shell.execute_reply":"2023-09-09T18:37:51.482350Z"},"trusted":true},"execution_count":null,"outputs":[]}],"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"}}