{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":12125,"databundleVersionId":862173,"sourceType":"competition"}],"dockerImageVersionId":30698,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-04-30T09:15:11.130903Z","iopub.execute_input":"2024-04-30T09:15:11.131300Z","iopub.status.idle":"2024-04-30T09:15:11.136575Z","shell.execute_reply.started":"2024-04-30T09:15:11.131271Z","shell.execute_reply":"2024-04-30T09:15:11.135288Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data=pd.read_csv(\"/kaggle/input/NFL-Punt-Analytics-Competition/game_data.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-04-30T09:15:11.138390Z","iopub.execute_input":"2024-04-30T09:15:11.139210Z","iopub.status.idle":"2024-04-30T09:15:11.168966Z","shell.execute_reply.started":"2024-04-30T09:15:11.139176Z","shell.execute_reply":"2024-04-30T09:15:11.167658Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data","metadata":{"execution":{"iopub.status.busy":"2024-04-30T09:15:11.171177Z","iopub.execute_input":"2024-04-30T09:15:11.171563Z","iopub.status.idle":"2024-04-30T09:15:11.199691Z","shell.execute_reply.started":"2024-04-30T09:15:11.171532Z","shell.execute_reply":"2024-04-30T09:15:11.198348Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\ncountplot=sns.countplot(data=data,x=\"Home_Team\")\nfor count in countplot.containers:\n    countplot.bar_label(count,)\nplt.xticks(rotation=90)\nplt.title(\"Count of Homes Matches for each Team\")\nplt.show()\nprint(data.Home_Team.value_counts())","metadata":{"execution":{"iopub.status.busy":"2024-04-30T09:15:11.201102Z","iopub.execute_input":"2024-04-30T09:15:11.201457Z","iopub.status.idle":"2024-04-30T09:15:11.915653Z","shell.execute_reply.started":"2024-04-30T09:15:11.201427Z","shell.execute_reply":"2024-04-30T09:15:11.914418Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"countplot=sns.countplot(data=data,x=\"Visit_Team\")\nfor count in countplot.containers:\n    countplot.bar_label(count,)\nplt.xticks(rotation=90)\nplt.title(\"Count of Visit Matches for each Team\")\nplt.show()\nprint(data.Visit_Team.value_counts())","metadata":{"execution":{"iopub.status.busy":"2024-04-30T09:15:11.918093Z","iopub.execute_input":"2024-04-30T09:15:11.918486Z","iopub.status.idle":"2024-04-30T09:15:12.560488Z","shell.execute_reply.started":"2024-04-30T09:15:11.918455Z","shell.execute_reply":"2024-04-30T09:15:12.559323Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# here below we see that the most of data is same but written in different type so making it as one","metadata":{}},{"cell_type":"code","source":"#stadium type\nprint(data.StadiumType.value_counts())\nprint(data.StadiumType.unique())\n","metadata":{"execution":{"iopub.status.busy":"2024-04-30T09:15:12.561930Z","iopub.execute_input":"2024-04-30T09:15:12.562338Z","iopub.status.idle":"2024-04-30T09:15:12.571183Z","shell.execute_reply.started":"2024-04-30T09:15:12.562301Z","shell.execute_reply":"2024-04-30T09:15:12.569847Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"replacement_Outdoor={\"Outdoors\":\"Outdoor\",\"Indoor, Non-Retractable Dome\":\"Outdoor\",\"Outside\":\"Outdoor\",\"Open\":\"Outdoor\",\"Outdoors \":\n                    \"Outdoor\",\"Ourdoor\":\"Outdoor\",\"Outddors\":\"Outdoor\",\"Oudoor\":\"Outdoor\",\"Outdor\":\"Outdoor\"}\n\ndata['StadiumType'] = data['StadiumType'].replace(replacement_Outdoor)\n\n\nreplacement_Indoor={\"Indoors\":\"Indoor\",\"outdoor\":\"Indoor\",\"Indoor, fixed roof\":\"Indoor\",\"Indoor, Fixed Roof\":\"Indoor\",\"Indoor, Roof Closed \":\n                    \"Indoor\"}\ndata['StadiumType'] = data['StadiumType'].replace(replacement_Indoor)\n\nreplacement_Retractable_Roof = {\n    \"Retr. Roof - Closed\": \"Retractable Roof\",\n    \"Retr. Roof-Closed\": \"Retractable Roof\",\n    \"Retr. Roof - Open\": \"Retractable Roof\",\n    \"Indoor, non-retractable roof\": \"Retractable Roof\",\n    \"Retr. Roof-Open\": \"Retractable Roof\",\n    \"Retr. Roof Closed\": \"Retractable Roof\",\n    \"Outdoor Retr Roof-Open\": \"Retractable Roof\",\n    \"Indoor, Roof Closed\": \"Retractable Roof\", \n    \"Indoor, Open Roof\": \"Retractable Roof\",\n    \"Retr. roof - closed\": \"Retractable Roof\"\n}\n\n\ndata['StadiumType'] = data['StadiumType'].replace(replacement_Retractable_Roof)\n\nreplacement_Dome={\"Indoors (Domed)\":\"Dome\",\"Domed, closed\":\"Dome\",\"Closed Dome\":\"Dome\",\"Dome, closed\":\"Dome\"}\ndata['StadiumType'] = data['StadiumType'].replace(replacement_Dome)\n","metadata":{"execution":{"iopub.status.busy":"2024-04-30T09:48:24.998201Z","iopub.execute_input":"2024-04-30T09:48:24.998611Z","iopub.status.idle":"2024-04-30T09:48:25.015371Z","shell.execute_reply.started":"2024-04-30T09:48:24.998582Z","shell.execute_reply":"2024-04-30T09:48:25.014304Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(data.StadiumType.value_counts())","metadata":{"execution":{"iopub.status.busy":"2024-04-30T09:48:34.061437Z","iopub.execute_input":"2024-04-30T09:48:34.061836Z","iopub.status.idle":"2024-04-30T09:48:34.069664Z","shell.execute_reply.started":"2024-04-30T09:48:34.061807Z","shell.execute_reply":"2024-04-30T09:48:34.068354Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#  here above we have converted and made are data accurate according to category","metadata":{}},{"cell_type":"code","source":"# Plot pie for the Satdium type\nplt.pie(data.StadiumType.value_counts(),labels = ['Outdoor', 'Indoor', 'Retractable Roof', 'Dome', 'Turf', 'Heinz Field'],autopct='%1.1f%%',explode=[0.2,0,0,0,0,0])\nplt.show()\n#here we can see that the maximum area is covered by the outside stadium ","metadata":{"execution":{"iopub.status.busy":"2024-04-30T09:56:50.719999Z","iopub.execute_input":"2024-04-30T09:56:50.720398Z","iopub.status.idle":"2024-04-30T09:56:50.897835Z","shell.execute_reply.started":"2024-04-30T09:56:50.720367Z","shell.execute_reply":"2024-04-30T09:56:50.895843Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#in which season most games wwere played\ndata.Season_Year.value_counts().plot(kind=\"bar\")\nplt.title(\"Games per Seasons\")\nplt.show()\n#both seasons had equal number of games","metadata":{"execution":{"iopub.status.busy":"2024-04-30T10:00:21.097060Z","iopub.execute_input":"2024-04-30T10:00:21.097920Z","iopub.status.idle":"2024-04-30T10:00:21.365325Z","shell.execute_reply.started":"2024-04-30T10:00:21.097884Z","shell.execute_reply":"2024-04-30T10:00:21.364195Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data.Game_Site.value_counts().plot(kind=\"bar\")\n#maximum games were played in East Rutherford","metadata":{"execution":{"iopub.status.busy":"2024-04-30T10:01:50.717343Z","iopub.execute_input":"2024-04-30T10:01:50.717736Z","iopub.status.idle":"2024-04-30T10:01:51.335117Z","shell.execute_reply.started":"2024-04-30T10:01:50.717707Z","shell.execute_reply":"2024-04-30T10:01:51.333891Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}