{"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":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"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)\nimport seaborn as sns\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\n# for 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":"2024-10-03T19:48:34.322017Z","iopub.execute_input":"2024-10-03T19:48:34.322408Z","iopub.status.idle":"2024-10-03T19:48:34.327434Z","shell.execute_reply.started":"2024-10-03T19:48:34.322370Z","shell.execute_reply":"2024-10-03T19:48:34.326504Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv('/kaggle/input/child-mind-institute-problematic-internet-use/train.csv')\ntest = pd.read_csv('/kaggle/input/child-mind-institute-problematic-internet-use/test.csv')","metadata":{"execution":{"iopub.status.busy":"2024-10-03T19:48:36.601623Z","iopub.execute_input":"2024-10-03T19:48:36.602052Z","iopub.status.idle":"2024-10-03T19:48:36.651661Z","shell.execute_reply.started":"2024-10-03T19:48:36.602011Z","shell.execute_reply":"2024-10-03T19:48:36.650779Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.describe()","metadata":{"execution":{"iopub.status.busy":"2024-10-03T19:20:09.459647Z","iopub.execute_input":"2024-10-03T19:20:09.460180Z","iopub.status.idle":"2024-10-03T19:20:09.612564Z","shell.execute_reply.started":"2024-10-03T19:20:09.460138Z","shell.execute_reply":"2024-10-03T19:20:09.611480Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.describe()","metadata":{"execution":{"iopub.status.busy":"2024-10-03T19:22:23.195061Z","iopub.execute_input":"2024-10-03T19:22:23.195726Z","iopub.status.idle":"2024-10-03T19:22:23.297177Z","shell.execute_reply.started":"2024-10-03T19:22:23.195686Z","shell.execute_reply":"2024-10-03T19:22:23.296082Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['sii'] = train['sii'].fillna('NaN')\n\n# Получим уникальные значения\nsii_value = train['sii'].unique()\n\n# Построим countplot\nsns.countplot(x='sii', data=train, order=sii_value)","metadata":{"execution":{"iopub.status.busy":"2024-10-03T20:01:26.794588Z","iopub.execute_input":"2024-10-03T20:01:26.795621Z","iopub.status.idle":"2024-10-03T20:01:26.987988Z","shell.execute_reply.started":"2024-10-03T20:01:26.795579Z","shell.execute_reply":"2024-10-03T20:01:26.986948Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"type(train.sii[4])","metadata":{"execution":{"iopub.status.busy":"2024-10-03T19:53:01.619388Z","iopub.execute_input":"2024-10-03T19:53:01.619780Z","iopub.status.idle":"2024-10-03T19:53:01.626389Z","shell.execute_reply.started":"2024-10-03T19:53:01.619741Z","shell.execute_reply":"2024-10-03T19:53:01.625453Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_dictionary = pd.read_csv('/kaggle/input/child-mind-institute-problematic-internet-use/data_dictionary.csv')","metadata":{"execution":{"iopub.status.busy":"2024-10-03T20:10:10.774588Z","iopub.execute_input":"2024-10-03T20:10:10.775013Z","iopub.status.idle":"2024-10-03T20:10:10.783124Z","shell.execute_reply.started":"2024-10-03T20:10:10.774971Z","shell.execute_reply":"2024-10-03T20:10:10.782064Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.groupby('sii').size()","metadata":{"execution":{"iopub.status.busy":"2024-10-03T20:14:57.360661Z","iopub.execute_input":"2024-10-03T20:14:57.361444Z","iopub.status.idle":"2024-10-03T20:14:57.370418Z","shell.execute_reply.started":"2024-10-03T20:14:57.361402Z","shell.execute_reply":"2024-10-03T20:14:57.369530Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"nan_sii_train = train.query('sii == \"NaN\"')\nnan_sii_train.describe(include = \"all\")","metadata":{"execution":{"iopub.status.busy":"2024-10-03T20:38:50.420325Z","iopub.execute_input":"2024-10-03T20:38:50.421099Z","iopub.status.idle":"2024-10-03T20:38:50.601983Z","shell.execute_reply.started":"2024-10-03T20:38:50.421059Z","shell.execute_reply":"2024-10-03T20:38:50.600965Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"nan_sii_train","metadata":{"execution":{"iopub.status.busy":"2024-10-03T20:46:10.207641Z","iopub.execute_input":"2024-10-03T20:46:10.208460Z","iopub.status.idle":"2024-10-03T20:46:10.237898Z","shell.execute_reply.started":"2024-10-03T20:46:10.208418Z","shell.execute_reply":"2024-10-03T20:46:10.237091Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"nan_sii_train.loc[:,'PreInt_EduHx-Season'] = nan_sii_train['PreInt_EduHx-Season'].fillna('NaN')\nnan_sii_train.loc[:,'PreInt_EduHx-computerinternet_hoursday'] = nan_sii_train['PreInt_EduHx-computerinternet_hoursday'].fillna('NaN')\n\nnan_sii_train['PreInt_EduHx-Season'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-10-03T20:58:29.910145Z","iopub.execute_input":"2024-10-03T20:58:29.910878Z","iopub.status.idle":"2024-10-03T20:58:29.921459Z","shell.execute_reply.started":"2024-10-03T20:58:29.910837Z","shell.execute_reply":"2024-10-03T20:58:29.920395Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"nan_sii_train['PreInt_EduHx-computerinternet_hoursday'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-10-03T20:58:47.368948Z","iopub.execute_input":"2024-10-03T20:58:47.369332Z","iopub.status.idle":"2024-10-03T20:58:47.377864Z","shell.execute_reply.started":"2024-10-03T20:58:47.369298Z","shell.execute_reply":"2024-10-03T20:58:47.376895Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}