{"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":"# Importing Libraries and Dataset","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n%matplotlib inline","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:01:31.913853Z","iopub.execute_input":"2022-09-24T18:01:31.914210Z","iopub.status.idle":"2022-09-24T18:01:32.493951Z","shell.execute_reply.started":"2022-09-24T18:01:31.914184Z","shell.execute_reply":"2022-09-24T18:01:32.492608Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path = \"/kaggle/input/big-data-derby-2022/nyra_2019_complete.csv\"\ndf = pd.read_csv(path, header = None, low_memory = False)\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:14:20.068165Z","iopub.execute_input":"2022-09-24T18:14:20.068535Z","iopub.status.idle":"2022-09-24T18:14:27.946535Z","shell.execute_reply.started":"2022-09-24T18:14:20.068509Z","shell.execute_reply":"2022-09-24T18:14:27.945051Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path1 = \"/kaggle/input/big-data-derby-2022/nyra_race_table.csv\"\ndf_race = pd.read_csv(path1)\ndf_race.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:04:08.712814Z","iopub.execute_input":"2022-09-24T18:04:08.713194Z","iopub.status.idle":"2022-09-24T18:04:08.731928Z","shell.execute_reply.started":"2022-09-24T18:04:08.713110Z","shell.execute_reply":"2022-09-24T18:04:08.731106Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path2 = \"/kaggle/input/big-data-derby-2022/nyra_start_table.csv\"\ndf_start = pd.read_csv(path2, header = None)\ndf_start.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:05:10.692643Z","iopub.execute_input":"2022-09-24T18:05:10.693860Z","iopub.status.idle":"2022-09-24T18:05:10.717929Z","shell.execute_reply.started":"2022-09-24T18:05:10.693810Z","shell.execute_reply":"2022-09-24T18:05:10.716757Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path3 = \"/kaggle/input/big-data-derby-2022/nyra_tracking_table.csv\"\ndf_track = pd.read_csv(path3)\ndf_track.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:06:29.477622Z","iopub.execute_input":"2022-09-24T18:06:29.477989Z","iopub.status.idle":"2022-09-24T18:06:37.079244Z","shell.execute_reply.started":"2022-09-24T18:06:29.477963Z","shell.execute_reply":"2022-09-24T18:06:37.078310Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_start.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:06:40.907008Z","iopub.execute_input":"2022-09-24T18:06:40.907362Z","iopub.status.idle":"2022-09-24T18:06:40.916509Z","shell.execute_reply.started":"2022-09-24T18:06:40.907336Z","shell.execute_reply":"2022-09-24T18:06:40.914926Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:06:49.104266Z","iopub.execute_input":"2022-09-24T18:06:49.104664Z","iopub.status.idle":"2022-09-24T18:06:49.113521Z","shell.execute_reply.started":"2022-09-24T18:06:49.104637Z","shell.execute_reply":"2022-09-24T18:06:49.111324Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_race.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:06:52.121335Z","iopub.execute_input":"2022-09-24T18:06:52.122024Z","iopub.status.idle":"2022-09-24T18:06:52.129042Z","shell.execute_reply.started":"2022-09-24T18:06:52.121996Z","shell.execute_reply":"2022-09-24T18:06:52.127582Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_track.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:06:55.671557Z","iopub.execute_input":"2022-09-24T18:06:55.671919Z","iopub.status.idle":"2022-09-24T18:06:55.680503Z","shell.execute_reply.started":"2022-09-24T18:06:55.671892Z","shell.execute_reply":"2022-09-24T18:06:55.679008Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We know that df_2019(nyra_2019_complete) is the combined data. Just as a check we can see that it has 5228430 rows which matches the number of rows in ny_tracking_table. This ensures we haven't missed out any datapoints. Also the complete table has no column names which have to provided as next steps.","metadata":{}},{"cell_type":"markdown","source":"# Provide Column Headers to all columns","metadata":{}},{"cell_type":"code","source":"df.rename(columns ={ 0:\"track_id\", 1:\"date\", 2:\"race_number\", 3: \"program_number\", 4:\"trakus_index\", 5:\"latitude\", 6:\"longitude\", 7:\"distance\", 8:\"course_type\", 9:\"track_condition\", 10:\"run_up_distance\", 11:\"race_type\", 12:\"purse\",13:\"post_time\",14:\"weight_carried\", 15:\"jockey\", 16:\"odds\", 17:\"finish_position\"}, inplace = True)\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-24T18:18:31.415227Z","iopub.execute_input":"2022-09-24T18:18:31.415608Z","iopub.status.idle":"2022-09-24T18:18:31.440465Z","shell.execute_reply.started":"2022-09-24T18:18:31.415581Z","shell.execute_reply":"2022-09-24T18:18:31.438293Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"I have done QA checks to ensure that every column is named correctly. Code for this is not included to keep the document look clean.","metadata":{}},{"cell_type":"markdown","source":"EDA Coming Soon","metadata":{}}]}