{"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":"markdown","source":"# Derby 2022 HistPlot","metadata":{"papermill":{"duration":0.003482,"end_time":"2022-07-03T15:34:26.115339","exception":false,"start_time":"2022-07-03T15:34:26.111857","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","metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","papermill":{"duration":1.092046,"end_time":"2022-07-03T15:34:27.210052","exception":false,"start_time":"2022-07-03T15:34:26.118006","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-09-04T06:35:33.984421Z","iopub.execute_input":"2022-09-04T06:35:33.985826Z","iopub.status.idle":"2022-09-04T06:35:33.993242Z","shell.execute_reply.started":"2022-09-04T06:35:33.985760Z","shell.execute_reply":"2022-09-04T06:35:33.991566Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train=pd.read_csv('../input/big-data-derby-2022/nyra_2019_complete.csv')\ndisplay(train[0:3])\ndisplay(train.info())\ncols=train.columns.tolist()\nprint(cols)\nprint(len(cols))","metadata":{"papermill":{"duration":1.331591,"end_time":"2022-07-03T15:34:28.544641","exception":false,"start_time":"2022-07-03T15:34:27.213050","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-09-04T06:35:34.004528Z","iopub.execute_input":"2022-09-04T06:35:34.005663Z","iopub.status.idle":"2022-09-04T06:35:46.805455Z","shell.execute_reply.started":"2022-09-04T06:35:34.005604Z","shell.execute_reply":"2022-09-04T06:35:46.803977Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['program_number']=train['program_number'].astype(str)","metadata":{"execution":{"iopub.status.busy":"2022-09-04T06:35:46.808700Z","iopub.execute_input":"2022-09-04T06:35:46.809139Z","iopub.status.idle":"2022-09-04T06:35:47.470831Z","shell.execute_reply.started":"2022-09-04T06:35:46.809101Z","shell.execute_reply":"2022-09-04T06:35:47.469217Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig, ax = plt.subplots(9,2,figsize=(15,36))\nfor i in tqdm(range(len(cols))):\n    r=i//2\n    c=i%2\n    sns.histplot(train[cols[i]], label=cols[i], ax=ax[r,c], color='C1',bins=40)\n    ax[r,c].legend()\n    ax[r,c].grid()\nplt.show()","metadata":{"papermill":{"duration":8.242853,"end_time":"2022-07-03T15:34:36.849335","exception":false,"start_time":"2022-07-03T15:34:28.606482","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-09-04T06:35:47.472559Z","iopub.execute_input":"2022-09-04T06:35:47.472976Z","iopub.status.idle":"2022-09-04T06:37:27.195797Z","shell.execute_reply.started":"2022-09-04T06:35:47.472940Z","shell.execute_reply":"2022-09-04T06:37:27.194433Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trainB=pd.read_csv('../input/big-data-derby-2022/nyra_race_table.csv')\ndisplay(trainB[0:3])\ndisplay(trainB.info())\ncolsB=trainB.columns.tolist()\nprint(colsB)\nprint(len(colsB))","metadata":{"papermill":{"duration":0.006909,"end_time":"2022-07-03T15:34:36.879045","exception":false,"start_time":"2022-07-03T15:34:36.872136","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-09-04T06:37:27.198678Z","iopub.execute_input":"2022-09-04T06:37:27.199261Z","iopub.status.idle":"2022-09-04T06:37:27.235528Z","shell.execute_reply.started":"2022-09-04T06:37:27.199223Z","shell.execute_reply":"2022-09-04T06:37:27.234299Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig, ax = plt.subplots(5,2,figsize=(15,20))\nfor i in tqdm(range(len(colsB))):\n    r=i//2\n    c=i%2\n    sns.histplot(trainB[colsB[i]], label=cols[i], ax=ax[r,c], color='C1',bins=40)\n    ax[r,c].legend()\n    ax[r,c].grid()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-09-04T06:37:27.237072Z","iopub.execute_input":"2022-09-04T06:37:27.237594Z","iopub.status.idle":"2022-09-04T06:37:33.230972Z","shell.execute_reply.started":"2022-09-04T06:37:27.237555Z","shell.execute_reply":"2022-09-04T06:37:33.229609Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trainC=pd.read_csv('../input/big-data-derby-2022/nyra_race_table.csv')\ndisplay(trainC[0:3])\ndisplay(trainC.info())\ncolsC=trainC.columns.tolist()\nprint(colsC)\nprint(len(colsC))","metadata":{"execution":{"iopub.status.busy":"2022-09-04T06:37:33.233038Z","iopub.execute_input":"2022-09-04T06:37:33.234296Z","iopub.status.idle":"2022-09-04T06:37:33.274377Z","shell.execute_reply.started":"2022-09-04T06:37:33.234235Z","shell.execute_reply":"2022-09-04T06:37:33.273287Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig, ax = plt.subplots(5,2,figsize=(15,20))\nfor i in tqdm(range(len(colsC))):\n    r=i//2\n    c=i%2\n    sns.histplot(trainC[colsC[i]], label=cols[i], ax=ax[r,c], color='C1',bins=40)\n    ax[r,c].legend()\n    ax[r,c].grid()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-09-04T06:37:33.275940Z","iopub.execute_input":"2022-09-04T06:37:33.277030Z","iopub.status.idle":"2022-09-04T06:37:38.388948Z","shell.execute_reply.started":"2022-09-04T06:37:33.276986Z","shell.execute_reply":"2022-09-04T06:37:38.387469Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trainC=pd.read_csv('../input/big-data-derby-2022/nyra_start_table.csv')\ndisplay(trainC[0:3])\ndisplay(trainC.info())\ncolsC=trainC.columns.tolist()\nprint(colsC)\nprint(len(colsC))","metadata":{"execution":{"iopub.status.busy":"2022-09-04T06:37:38.391298Z","iopub.execute_input":"2022-09-04T06:37:38.391885Z","iopub.status.idle":"2022-09-04T06:37:38.451737Z","shell.execute_reply.started":"2022-09-04T06:37:38.391825Z","shell.execute_reply":"2022-09-04T06:37:38.450201Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig, ax = plt.subplots(4,2,figsize=(15,16))\nfor i in tqdm(range(len(colsC))):\n    r=i//2\n    c=i%2\n    sns.histplot(trainC[colsC[i]], label=cols[i], ax=ax[r,c], color='C1',bins=40)\n    ax[r,c].legend()\n    ax[r,c].grid()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-09-04T06:37:38.454085Z","iopub.execute_input":"2022-09-04T06:37:38.454827Z","iopub.status.idle":"2022-09-04T06:37:46.899260Z","shell.execute_reply.started":"2022-09-04T06:37:38.454769Z","shell.execute_reply":"2022-09-04T06:37:46.897793Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trainD=pd.read_csv('../input/big-data-derby-2022/nyra_tracking_table.csv')\ndisplay(trainD[0:3])\ndisplay(trainD.info())\ncolsD=trainD.columns.tolist()\nprint(colsD)\nprint(len(colsD))","metadata":{"execution":{"iopub.status.busy":"2022-09-04T06:37:46.904010Z","iopub.execute_input":"2022-09-04T06:37:46.904609Z","iopub.status.idle":"2022-09-04T06:37:54.030807Z","shell.execute_reply.started":"2022-09-04T06:37:46.904563Z","shell.execute_reply":"2022-09-04T06:37:54.029501Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig, ax = plt.subplots(4,2,figsize=(15,16))\nfor i in tqdm(range(len(colsD))):\n    r=i//2\n    c=i%2\n    sns.histplot(trainD[colsD[i]], label=cols[i], ax=ax[r,c], color='C1',bins=40)\n    ax[r,c].legend()\n    ax[r,c].grid()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-09-04T06:37:54.032779Z","iopub.execute_input":"2022-09-04T06:37:54.033201Z","iopub.status.idle":"2022-09-04T06:38:36.412149Z","shell.execute_reply.started":"2022-09-04T06:37:54.033161Z","shell.execute_reply":"2022-09-04T06:38:36.410809Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}