{"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","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"},"papermill":{"default_parameters":{},"duration":42.399313,"end_time":"2022-09-13T14:09:35.443305","environment_variables":{},"exception":null,"input_path":"__notebook__.ipynb","output_path":"__notebook__.ipynb","parameters":{},"start_time":"2022-09-13T14:08:53.043992","version":"2.3.4"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":81933,"databundleVersionId":9643020,"sourceType":"competition"}],"dockerImageVersionId":30626,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# CMI Data HistPlot","metadata":{"papermill":{"duration":0.004852,"end_time":"2022-09-13T14:09:03.598005","exception":false,"start_time":"2022-09-13T14:09:03.593153","status":"completed"},"tags":[]}},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport os\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom tqdm import tqdm\nimport plotly.express as px\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots","metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","papermill":{"duration":2.47983,"end_time":"2022-09-13T14:09:06.081763","exception":false,"start_time":"2022-09-13T14:09:03.601933","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-09-20T13:19:13.535585Z","iopub.execute_input":"2024-09-20T13:19:13.536539Z","iopub.status.idle":"2024-09-20T13:19:16.502452Z","shell.execute_reply.started":"2024-09-20T13:19:13.536481Z","shell.execute_reply":"2024-09-20T13:19:16.501147Z"},"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":{"papermill":{"duration":0.170345,"end_time":"2022-09-13T14:09:06.256061","exception":false,"start_time":"2022-09-13T14:09:06.085716","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-09-20T13:19:16.504737Z","iopub.execute_input":"2024-09-20T13:19:16.505491Z","iopub.status.idle":"2024-09-20T13:19:16.591434Z","shell.execute_reply.started":"2024-09-20T13:19:16.505439Z","shell.execute_reply":"2024-09-20T13:19:16.590041Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(len(train),len(test))","metadata":{"execution":{"iopub.status.busy":"2024-09-20T13:19:16.592981Z","iopub.execute_input":"2024-09-20T13:19:16.593508Z","iopub.status.idle":"2024-09-20T13:19:16.600865Z","shell.execute_reply.started":"2024-09-20T13:19:16.593461Z","shell.execute_reply":"2024-09-20T13:19:16.599323Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"display(train[0:3])\n#display(train.info())","metadata":{"papermill":{"duration":0.035518,"end_time":"2022-09-13T14:09:06.295235","exception":false,"start_time":"2022-09-13T14:09:06.259717","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-09-20T13:19:16.604013Z","iopub.execute_input":"2024-09-20T13:19:16.605362Z","iopub.status.idle":"2024-09-20T13:19:16.652724Z","shell.execute_reply.started":"2024-09-20T13:19:16.605312Z","shell.execute_reply":"2024-09-20T13:19:16.651365Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cols=train.columns.tolist()\nprint(cols)\nprint(len(cols))","metadata":{"papermill":{"duration":0.016405,"end_time":"2022-09-13T14:09:06.315603","exception":false,"start_time":"2022-09-13T14:09:06.299198","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-09-20T13:19:16.654627Z","iopub.execute_input":"2024-09-20T13:19:16.655094Z","iopub.status.idle":"2024-09-20T13:19:16.661775Z","shell.execute_reply.started":"2024-09-20T13:19:16.655052Z","shell.execute_reply":"2024-09-20T13:19:16.660327Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tcols=test.columns.tolist()\nprint(tcols)\nprint(len(tcols))","metadata":{"execution":{"iopub.status.busy":"2024-09-20T13:27:18.406215Z","iopub.execute_input":"2024-09-20T13:27:18.406650Z","iopub.status.idle":"2024-09-20T13:27:18.412742Z","shell.execute_reply.started":"2024-09-20T13:27:18.406616Z","shell.execute_reply":"2024-09-20T13:27:18.411547Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for col in cols:\n    print(col,train[col].nunique())","metadata":{"execution":{"iopub.status.busy":"2024-09-20T13:19:16.663336Z","iopub.execute_input":"2024-09-20T13:19:16.664163Z","iopub.status.idle":"2024-09-20T13:19:16.702441Z","shell.execute_reply.started":"2024-09-20T13:19:16.664116Z","shell.execute_reply":"2024-09-20T13:19:16.700740Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig, ax = plt.subplots(41,2,figsize=(12,41*4))\nplt.subplots_adjust(hspace=0.5)\nfor i in tqdm(range(len(cols))):\n    r=i//2\n    c=i%2\n    sns.histplot(train[cols[i]], label='train '+cols[i], ax=ax[r,c], color='C1',bins=40, alpha=0.9)\n    ax[r,c].legend()\n    ax[r,c].grid()\n    ax[r,c].tick_params(axis='x', labelrotation=80)\nplt.show()","metadata":{"papermill":{"duration":0.016812,"end_time":"2022-09-13T14:09:34.604792","exception":false,"start_time":"2022-09-13T14:09:34.58798","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-09-20T13:33:02.868624Z","iopub.execute_input":"2024-09-20T13:33:02.869058Z","iopub.status.idle":"2024-09-20T13:34:02.355135Z","shell.execute_reply.started":"2024-09-20T13:33:02.869022Z","shell.execute_reply":"2024-09-20T13:34:02.353905Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}