{"metadata":{"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"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nfrom scipy.stats import skew \nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nimport sys\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-08-21T23:34:50.882528Z","iopub.execute_input":"2022-08-21T23:34:50.883082Z","iopub.status.idle":"2022-08-21T23:34:51.800653Z","shell.execute_reply.started":"2022-08-21T23:34:50.882974Z","shell.execute_reply":"2022-08-21T23:34:51.799601Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# ****showing data","metadata":{}},{"cell_type":"code","source":"data_race=pd.read_csv(\"../input/big-data-derby-2022/nyra_race_table.csv\")\ndata_start=pd.read_csv(\"../input/big-data-derby-2022/nyra_start_table.csv\")\ndata_tracking=pd.read_csv(\"../input/big-data-derby-2022/nyra_tracking_table.csv\")\ndata_complete=pd.read_csv(\"../input/big-data-derby-2022/nyra_2019_complete.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:34:51.804500Z","iopub.execute_input":"2022-08-21T23:34:51.804809Z","iopub.status.idle":"2022-08-21T23:35:10.496988Z","shell.execute_reply.started":"2022-08-21T23:34:51.804768Z","shell.execute_reply":"2022-08-21T23:35:10.495883Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_race.head()\n","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:10.498480Z","iopub.execute_input":"2022-08-21T23:35:10.499451Z","iopub.status.idle":"2022-08-21T23:35:10.522423Z","shell.execute_reply.started":"2022-08-21T23:35:10.499417Z","shell.execute_reply":"2022-08-21T23:35:10.521488Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_start.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:10.525215Z","iopub.execute_input":"2022-08-21T23:35:10.525675Z","iopub.status.idle":"2022-08-21T23:35:10.540324Z","shell.execute_reply.started":"2022-08-21T23:35:10.525637Z","shell.execute_reply":"2022-08-21T23:35:10.539272Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_tracking.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:10.541690Z","iopub.execute_input":"2022-08-21T23:35:10.542320Z","iopub.status.idle":"2022-08-21T23:35:10.558582Z","shell.execute_reply.started":"2022-08-21T23:35:10.542280Z","shell.execute_reply":"2022-08-21T23:35:10.557697Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_complete.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:10.562354Z","iopub.execute_input":"2022-08-21T23:35:10.562661Z","iopub.status.idle":"2022-08-21T23:35:10.579646Z","shell.execute_reply.started":"2022-08-21T23:35:10.562636Z","shell.execute_reply":"2022-08-21T23:35:10.578644Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# null values****","metadata":{}},{"cell_type":"code","source":"data_race.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:10.581236Z","iopub.execute_input":"2022-08-21T23:35:10.582129Z","iopub.status.idle":"2022-08-21T23:35:10.593735Z","shell.execute_reply.started":"2022-08-21T23:35:10.582080Z","shell.execute_reply":"2022-08-21T23:35:10.592053Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_tracking.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:10.594868Z","iopub.execute_input":"2022-08-21T23:35:10.595135Z","iopub.status.idle":"2022-08-21T23:35:11.192320Z","shell.execute_reply.started":"2022-08-21T23:35:10.595111Z","shell.execute_reply":"2022-08-21T23:35:11.191289Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_start.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:11.193829Z","iopub.execute_input":"2022-08-21T23:35:11.194202Z","iopub.status.idle":"2022-08-21T23:35:11.208335Z","shell.execute_reply.started":"2022-08-21T23:35:11.194163Z","shell.execute_reply":"2022-08-21T23:35:11.207268Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_complete.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:11.212896Z","iopub.execute_input":"2022-08-21T23:35:11.213173Z","iopub.status.idle":"2022-08-21T23:35:12.562232Z","shell.execute_reply.started":"2022-08-21T23:35:11.213147Z","shell.execute_reply":"2022-08-21T23:35:12.561261Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# ****#skewed vlues","metadata":{}},{"cell_type":"code","source":"def skews(dataset):\n    return dataset.skew().sort_values(ascending=False)\n    ","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:12.563828Z","iopub.execute_input":"2022-08-21T23:35:12.564232Z","iopub.status.idle":"2022-08-21T23:35:12.569415Z","shell.execute_reply.started":"2022-08-21T23:35:12.564194Z","shell.execute_reply":"2022-08-21T23:35:12.568113Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"skews(data_race)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:12.571178Z","iopub.execute_input":"2022-08-21T23:35:12.571941Z","iopub.status.idle":"2022-08-21T23:35:12.588643Z","shell.execute_reply.started":"2022-08-21T23:35:12.571904Z","shell.execute_reply":"2022-08-21T23:35:12.587752Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"skews(data_start)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:12.589875Z","iopub.execute_input":"2022-08-21T23:35:12.591004Z","iopub.status.idle":"2022-08-21T23:35:12.604454Z","shell.execute_reply.started":"2022-08-21T23:35:12.590968Z","shell.execute_reply":"2022-08-21T23:35:12.603472Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"skews(data_tracking)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:12.605807Z","iopub.execute_input":"2022-08-21T23:35:12.606415Z","iopub.status.idle":"2022-08-21T23:35:13.424530Z","shell.execute_reply.started":"2022-08-21T23:35:12.606380Z","shell.execute_reply":"2022-08-21T23:35:13.423413Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"skews(data_complete)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:13.426027Z","iopub.execute_input":"2022-08-21T23:35:13.427688Z","iopub.status.idle":"2022-08-21T23:35:15.308233Z","shell.execute_reply.started":"2022-08-21T23:35:13.427658Z","shell.execute_reply":"2022-08-21T23:35:15.307060Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# ****visualize skewed","metadata":{}},{"cell_type":"code","source":"def vis(dataset):\n    return  sns.displot(dataset, bins=82, kde=True)\n    ","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:15.309844Z","iopub.execute_input":"2022-08-21T23:35:15.310451Z","iopub.status.idle":"2022-08-21T23:35:15.316201Z","shell.execute_reply.started":"2022-08-21T23:35:15.310412Z","shell.execute_reply":"2022-08-21T23:35:15.314755Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"vis(data_race)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:15.318121Z","iopub.execute_input":"2022-08-21T23:35:15.318922Z","iopub.status.idle":"2022-08-21T23:35:16.683294Z","shell.execute_reply.started":"2022-08-21T23:35:15.318875Z","shell.execute_reply":"2022-08-21T23:35:16.682319Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"vis(data_start)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:16.684890Z","iopub.execute_input":"2022-08-21T23:35:16.685536Z","iopub.status.idle":"2022-08-21T23:35:18.146787Z","shell.execute_reply.started":"2022-08-21T23:35:16.685494Z","shell.execute_reply":"2022-08-21T23:35:18.145820Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#vis(data_tracking)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.148194Z","iopub.execute_input":"2022-08-21T23:35:18.148895Z","iopub.status.idle":"2022-08-21T23:35:18.153616Z","shell.execute_reply.started":"2022-08-21T23:35:18.148855Z","shell.execute_reply":"2022-08-21T23:35:18.152621Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#vis(data_complete)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.155262Z","iopub.execute_input":"2022-08-21T23:35:18.155980Z","iopub.status.idle":"2022-08-21T23:35:18.164548Z","shell.execute_reply.started":"2022-08-21T23:35:18.155943Z","shell.execute_reply":"2022-08-21T23:35:18.163547Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"markdown","source":"# **Remove outlier to clean skewed****\n ","metadata":{}},{"cell_type":"code","source":"def outlier(dataset):\n    q1=dataset.quantile(0.25)\n    q3=dataset.quantile(0.75)\n    IQR=q3-q1\n    lower=q1-1.5*IQR\n    higher=q3+1.5*IQR\n    dataset[(dataset>lower)&(dataset<higher)]\n    \n    return dataset.head(10)\n","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.167777Z","iopub.execute_input":"2022-08-21T23:35:18.168159Z","iopub.status.idle":"2022-08-21T23:35:18.176198Z","shell.execute_reply.started":"2022-08-21T23:35:18.168115Z","shell.execute_reply":"2022-08-21T23:35:18.175125Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_race=outlier(data_race.head()).copy()\ndata_race","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.177732Z","iopub.execute_input":"2022-08-21T23:35:18.179654Z","iopub.status.idle":"2022-08-21T23:35:18.208890Z","shell.execute_reply.started":"2022-08-21T23:35:18.179457Z","shell.execute_reply":"2022-08-21T23:35:18.207991Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_start=outlier(data_start.head()).copy()\ndata_start","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.210208Z","iopub.execute_input":"2022-08-21T23:35:18.210555Z","iopub.status.idle":"2022-08-21T23:35:18.233251Z","shell.execute_reply.started":"2022-08-21T23:35:18.210520Z","shell.execute_reply":"2022-08-21T23:35:18.231988Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_tracking=outlier(data_tracking.head()).copy()\ndata_tracking","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.234616Z","iopub.execute_input":"2022-08-21T23:35:18.235028Z","iopub.status.idle":"2022-08-21T23:35:18.259618Z","shell.execute_reply.started":"2022-08-21T23:35:18.234986Z","shell.execute_reply":"2022-08-21T23:35:18.258330Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_complete=outlier(data_complete.head()).copy()\ndata_complete","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.261184Z","iopub.execute_input":"2022-08-21T23:35:18.261768Z","iopub.status.idle":"2022-08-21T23:35:18.293127Z","shell.execute_reply.started":"2022-08-21T23:35:18.261732Z","shell.execute_reply":"2022-08-21T23:35:18.292209Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **skewes after delete outlieres**","metadata":{}},{"cell_type":"code","source":"def skewsafterdeleteoutlires(dataset):\n    return dataset.skew().sort_values(ascending=False)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:38:15.122170Z","iopub.execute_input":"2022-08-21T23:38:15.122628Z","iopub.status.idle":"2022-08-21T23:38:15.129437Z","shell.execute_reply.started":"2022-08-21T23:38:15.122590Z","shell.execute_reply":"2022-08-21T23:38:15.128277Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"skewsafterdeleteoutlires(data_race)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:38:27.308058Z","iopub.execute_input":"2022-08-21T23:38:27.308491Z","iopub.status.idle":"2022-08-21T23:38:27.319620Z","shell.execute_reply.started":"2022-08-21T23:38:27.308453Z","shell.execute_reply":"2022-08-21T23:38:27.318443Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"skewsafterdeleteoutlires(data_start)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:39:17.855151Z","iopub.execute_input":"2022-08-21T23:39:17.856113Z","iopub.status.idle":"2022-08-21T23:39:17.867615Z","shell.execute_reply.started":"2022-08-21T23:39:17.856058Z","shell.execute_reply":"2022-08-21T23:39:17.866315Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"skewsafterdeleteoutlires(data_tracking)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:39:21.067775Z","iopub.execute_input":"2022-08-21T23:39:21.068844Z","iopub.status.idle":"2022-08-21T23:39:21.079716Z","shell.execute_reply.started":"2022-08-21T23:39:21.068792Z","shell.execute_reply":"2022-08-21T23:39:21.078203Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"skewsafterdeleteoutlires(data_complete)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:39:22.979064Z","iopub.execute_input":"2022-08-21T23:39:22.980159Z","iopub.status.idle":"2022-08-21T23:39:22.991748Z","shell.execute_reply.started":"2022-08-21T23:39:22.980101Z","shell.execute_reply":"2022-08-21T23:39:22.990675Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# ****visualize after delete outlire","metadata":{}},{"cell_type":"code","source":"def visafterdelete(dataset):\n    return  sns.displot(dataset, bins=82, kde=True)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:40:14.466267Z","iopub.execute_input":"2022-08-21T23:40:14.467362Z","iopub.status.idle":"2022-08-21T23:40:14.475406Z","shell.execute_reply.started":"2022-08-21T23:40:14.467317Z","shell.execute_reply":"2022-08-21T23:40:14.474294Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"visafterdelete(data_race)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:40:55.489946Z","iopub.execute_input":"2022-08-21T23:40:55.490507Z","iopub.status.idle":"2022-08-21T23:40:57.224332Z","shell.execute_reply.started":"2022-08-21T23:40:55.490466Z","shell.execute_reply":"2022-08-21T23:40:57.223267Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"visafterdelete(data_start)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:41:00.775387Z","iopub.execute_input":"2022-08-21T23:41:00.776429Z","iopub.status.idle":"2022-08-21T23:41:03.237960Z","shell.execute_reply.started":"2022-08-21T23:41:00.776377Z","shell.execute_reply":"2022-08-21T23:41:03.236922Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"visafterdelete(data_tracking)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:41:09.434463Z","iopub.execute_input":"2022-08-21T23:41:09.435315Z","iopub.status.idle":"2022-08-21T23:41:10.530996Z","shell.execute_reply.started":"2022-08-21T23:41:09.435260Z","shell.execute_reply":"2022-08-21T23:41:10.529947Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"visafterdelete(data_complete)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:41:13.731685Z","iopub.execute_input":"2022-08-21T23:41:13.732523Z","iopub.status.idle":"2022-08-21T23:41:15.825396Z","shell.execute_reply.started":"2022-08-21T23:41:13.732481Z","shell.execute_reply":"2022-08-21T23:41:15.824404Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **categorical data**","metadata":{}},{"cell_type":"code","source":"data_race.info()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.296310Z","iopub.execute_input":"2022-08-21T23:35:18.296679Z","iopub.status.idle":"2022-08-21T23:35:18.311815Z","shell.execute_reply.started":"2022-08-21T23:35:18.296652Z","shell.execute_reply":"2022-08-21T23:35:18.310899Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_start.info()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.312908Z","iopub.execute_input":"2022-08-21T23:35:18.313181Z","iopub.status.idle":"2022-08-21T23:35:18.326623Z","shell.execute_reply.started":"2022-08-21T23:35:18.313155Z","shell.execute_reply":"2022-08-21T23:35:18.325700Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_tracking.info()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.332003Z","iopub.execute_input":"2022-08-21T23:35:18.332292Z","iopub.status.idle":"2022-08-21T23:35:18.346173Z","shell.execute_reply.started":"2022-08-21T23:35:18.332260Z","shell.execute_reply":"2022-08-21T23:35:18.345270Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_complete.info()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.347529Z","iopub.execute_input":"2022-08-21T23:35:18.348039Z","iopub.status.idle":"2022-08-21T23:35:18.363735Z","shell.execute_reply.started":"2022-08-21T23:35:18.348000Z","shell.execute_reply":"2022-08-21T23:35:18.362636Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def objectdata(dataset):\n    objectdatas=[]\n    for i in dataset.columns:\n        if dataset[i].dtypes=='object':\n            objectdatas.append(i)\n    return objectdatas     \n    \n   ","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.365199Z","iopub.execute_input":"2022-08-21T23:35:18.365870Z","iopub.status.idle":"2022-08-21T23:35:18.372356Z","shell.execute_reply.started":"2022-08-21T23:35:18.365831Z","shell.execute_reply":"2022-08-21T23:35:18.371177Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"objectdata(data_complete)\n","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.374166Z","iopub.execute_input":"2022-08-21T23:35:18.374745Z","iopub.status.idle":"2022-08-21T23:35:18.384865Z","shell.execute_reply.started":"2022-08-21T23:35:18.374716Z","shell.execute_reply":"2022-08-21T23:35:18.383695Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"objectdata(data_race)\n","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.386204Z","iopub.execute_input":"2022-08-21T23:35:18.387560Z","iopub.status.idle":"2022-08-21T23:35:18.396537Z","shell.execute_reply.started":"2022-08-21T23:35:18.387515Z","shell.execute_reply":"2022-08-21T23:35:18.395297Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"objectdata(data_start)\n","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.398396Z","iopub.execute_input":"2022-08-21T23:35:18.398909Z","iopub.status.idle":"2022-08-21T23:35:18.406820Z","shell.execute_reply.started":"2022-08-21T23:35:18.398872Z","shell.execute_reply":"2022-08-21T23:35:18.405657Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"objectdata(data_tracking)\n","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.408189Z","iopub.execute_input":"2022-08-21T23:35:18.408699Z","iopub.status.idle":"2022-08-21T23:35:18.417283Z","shell.execute_reply.started":"2022-08-21T23:35:18.408664Z","shell.execute_reply":"2022-08-21T23:35:18.416169Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **drop id column**","metadata":{}},{"cell_type":"code","source":"data_start=data_start.drop('track_id',axis=1)\ndata_start","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.418648Z","iopub.execute_input":"2022-08-21T23:35:18.419771Z","iopub.status.idle":"2022-08-21T23:35:18.433144Z","shell.execute_reply.started":"2022-08-21T23:35:18.419736Z","shell.execute_reply":"2022-08-21T23:35:18.431912Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_race=data_race.drop('track_id',axis=1)\ndata_race","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.434708Z","iopub.execute_input":"2022-08-21T23:35:18.435492Z","iopub.status.idle":"2022-08-21T23:35:18.451295Z","shell.execute_reply.started":"2022-08-21T23:35:18.435424Z","shell.execute_reply":"2022-08-21T23:35:18.450294Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_tracking=data_tracking.drop('track_id',axis=1)\ndata_tracking","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.453010Z","iopub.execute_input":"2022-08-21T23:35:18.453513Z","iopub.status.idle":"2022-08-21T23:35:18.467476Z","shell.execute_reply.started":"2022-08-21T23:35:18.453477Z","shell.execute_reply":"2022-08-21T23:35:18.466393Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_complete=data_complete.drop('track_id',axis=1)\ndata_complete","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.468852Z","iopub.execute_input":"2022-08-21T23:35:18.469492Z","iopub.status.idle":"2022-08-21T23:35:18.486734Z","shell.execute_reply.started":"2022-08-21T23:35:18.469456Z","shell.execute_reply":"2022-08-21T23:35:18.485647Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# ****encoder object columns","metadata":{}},{"cell_type":"code","source":"def encoder(dataset):\n    if objectdata(dataset):\n        dataset=pd.get_dummies(dataset,columns=objectdata(dataset),drop_first=\"True\")\n    return dataset.head() ","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.488180Z","iopub.execute_input":"2022-08-21T23:35:18.488864Z","iopub.status.idle":"2022-08-21T23:35:18.494661Z","shell.execute_reply.started":"2022-08-21T23:35:18.488826Z","shell.execute_reply":"2022-08-21T23:35:18.493452Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_complete=encoder(data_complete).copy()\ndata_complete","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.497496Z","iopub.execute_input":"2022-08-21T23:35:18.498664Z","iopub.status.idle":"2022-08-21T23:35:18.519802Z","shell.execute_reply.started":"2022-08-21T23:35:18.498614Z","shell.execute_reply":"2022-08-21T23:35:18.518749Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_race=encoder(data_race).copy()\ndata_race","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.521188Z","iopub.execute_input":"2022-08-21T23:35:18.521815Z","iopub.status.idle":"2022-08-21T23:35:18.539151Z","shell.execute_reply.started":"2022-08-21T23:35:18.521779Z","shell.execute_reply":"2022-08-21T23:35:18.537838Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_tracking=encoder(data_tracking).copy()\ndata_tracking","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.541084Z","iopub.execute_input":"2022-08-21T23:35:18.542588Z","iopub.status.idle":"2022-08-21T23:35:18.557287Z","shell.execute_reply.started":"2022-08-21T23:35:18.542558Z","shell.execute_reply":"2022-08-21T23:35:18.556227Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_start=encoder(data_start).copy()\ndata_start","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:35:18.559136Z","iopub.execute_input":"2022-08-21T23:35:18.559901Z","iopub.status.idle":"2022-08-21T23:35:18.577448Z","shell.execute_reply.started":"2022-08-21T23:35:18.559862Z","shell.execute_reply":"2022-08-21T23:35:18.576464Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2022-08-21T23:37:02.025232Z","iopub.execute_input":"2022-08-21T23:37:02.026550Z","iopub.status.idle":"2022-08-21T23:37:02.037671Z","shell.execute_reply.started":"2022-08-21T23:37:02.026497Z","shell.execute_reply":"2022-08-21T23:37:02.036299Z"},"trusted":true},"execution_count":null,"outputs":[]}]}