{"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\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom matplotlib import style","metadata":{"_uuid":"5ac679fe-6d2e-451c-9b78-0a410ae33cde","_cell_guid":"43f4964e-279b-4a55-9420-1258b165d0e3","jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:17.744721Z","iopub.execute_input":"2021-11-22T12:42:17.74506Z","iopub.status.idle":"2021-11-22T12:42:18.137922Z","shell.execute_reply.started":"2021-11-22T12:42:17.744973Z","shell.execute_reply":"2021-11-22T12:42:18.137059Z"},"collapsed":false},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Reading  games data","metadata":{"_uuid":"57ac2518-cbfc-4676-805e-6b1fe63d0ada","_cell_guid":"55a94a07-2f7b-4846-ae46-5432d4db67af","trusted":true}},{"cell_type":"code","source":"df=pd.read_csv('../input/nfl-big-data-bowl-2022/games.csv')\ndf","metadata":{"_uuid":"3b6e4656-6d74-493a-b016-671663eb91d0","_cell_guid":"78718939-4fc0-4879-8f1a-26d83f3ccd96","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.139777Z","iopub.execute_input":"2021-11-22T12:42:18.14003Z","iopub.status.idle":"2021-11-22T12:42:18.166Z","shell.execute_reply.started":"2021-11-22T12:42:18.14Z","shell.execute_reply":"2021-11-22T12:42:18.16516Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.columns","metadata":{"_uuid":"109b9208-37d6-4843-9e11-13c219ea02e5","_cell_guid":"3e3ac340-fc03-482c-aa84-26b9988496c2","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.167286Z","iopub.execute_input":"2021-11-22T12:42:18.168047Z","iopub.status.idle":"2021-11-22T12:42:18.174727Z","shell.execute_reply.started":"2021-11-22T12:42:18.168Z","shell.execute_reply":"2021-11-22T12:42:18.174105Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"_uuid":"41670266-cdd7-41bc-81e0-7f745b853643","_cell_guid":"fcb1c7b0-84cc-4eb2-b3e6-1e5500342bb4","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.175741Z","iopub.execute_input":"2021-11-22T12:42:18.176451Z","iopub.status.idle":"2021-11-22T12:42:18.195805Z","shell.execute_reply.started":"2021-11-22T12:42:18.176417Z","shell.execute_reply":"2021-11-22T12:42:18.195209Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.isnull()","metadata":{"_uuid":"ecc35b51-47a7-4d45-b3c7-eb0448154ba8","_cell_guid":"50872f53-a458-4cf2-bd2f-d51a6bde7bea","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.197706Z","iopub.execute_input":"2021-11-22T12:42:18.198138Z","iopub.status.idle":"2021-11-22T12:42:18.217182Z","shell.execute_reply.started":"2021-11-22T12:42:18.198103Z","shell.execute_reply":"2021-11-22T12:42:18.216277Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape","metadata":{"_uuid":"f7eac0a3-d2f6-4c04-b379-0d8cbfa8d2ea","_cell_guid":"03b5b184-3beb-47d6-9357-1c301198cc29","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.218519Z","iopub.execute_input":"2021-11-22T12:42:18.218728Z","iopub.status.idle":"2021-11-22T12:42:18.232092Z","shell.execute_reply.started":"2021-11-22T12:42:18.218702Z","shell.execute_reply":"2021-11-22T12:42:18.231183Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Extracting all information about data","metadata":{"_uuid":"326635c5-da3d-4b95-a6b5-23fbc31c7fb1","_cell_guid":"e0febc06-e5b0-498b-9d67-c4135ca76661","trusted":true}},{"cell_type":"code","source":"df.info()","metadata":{"_uuid":"7bd89e3d-b70d-40ac-89bc-13372dba5e9f","_cell_guid":"1b7073a0-2b69-41a2-8364-b8c27f88a335","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.233499Z","iopub.execute_input":"2021-11-22T12:42:18.233992Z","iopub.status.idle":"2021-11-22T12:42:18.251159Z","shell.execute_reply.started":"2021-11-22T12:42:18.233946Z","shell.execute_reply":"2021-11-22T12:42:18.250185Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.describe()","metadata":{"_uuid":"4003b98a-3be6-4a91-995b-05118c00783a","_cell_guid":"8b04b8db-12cf-4876-8fc6-85daa016518b","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.252856Z","iopub.execute_input":"2021-11-22T12:42:18.253161Z","iopub.status.idle":"2021-11-22T12:42:18.278761Z","shell.execute_reply.started":"2021-11-22T12:42:18.253121Z","shell.execute_reply":"2021-11-22T12:42:18.277932Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.isnull().sum()","metadata":{"_uuid":"b6c3d11d-4037-4c21-b1a1-179a2c407ab7","_cell_guid":"94ad152a-81de-42c1-af5b-b75debf241e8","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.280332Z","iopub.execute_input":"2021-11-22T12:42:18.280943Z","iopub.status.idle":"2021-11-22T12:42:18.289506Z","shell.execute_reply.started":"2021-11-22T12:42:18.280896Z","shell.execute_reply":"2021-11-22T12:42:18.288826Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.nunique()","metadata":{"_uuid":"fd30a462-fbf9-41b0-a36e-02b5a4d56e98","_cell_guid":"2033c499-47ce-475b-9d9e-334d2d58d87b","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.29064Z","iopub.execute_input":"2021-11-22T12:42:18.291174Z","iopub.status.idle":"2021-11-22T12:42:18.306619Z","shell.execute_reply.started":"2021-11-22T12:42:18.291131Z","shell.execute_reply":"2021-11-22T12:42:18.305855Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Plotting","metadata":{"_uuid":"8a6f2b82-ed60-4682-bbcf-9b02ceb34585","_cell_guid":"4b1b068c-3615-4dd1-899b-4a6c06285527","trusted":true}},{"cell_type":"code","source":"df.hist()\nplt.show()","metadata":{"_uuid":"553b87c4-d285-4122-bc09-58c80f7f0bf2","_cell_guid":"fa6c8cf6-ae74-4edb-a287-e662d5129cf8","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.307731Z","iopub.execute_input":"2021-11-22T12:42:18.30845Z","iopub.status.idle":"2021-11-22T12:42:18.868835Z","shell.execute_reply.started":"2021-11-22T12:42:18.308406Z","shell.execute_reply":"2021-11-22T12:42:18.867819Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Number of match played in each season","metadata":{"_uuid":"efc83c2e-8a2a-49bc-b5e0-6cffd99a77c8","_cell_guid":"6bc14984-d842-4644-86c2-928dc562332e","trusted":true}},{"cell_type":"code","source":"\nsns.countplot(x=\"season\", data=df)\nplt.title(\"Total number of match played in every season\")\nplt.xlabel(\"Season\",fontsize=15)\nplt.ylabel(\"Number of matches\",fontsize=15)\nplt.show()","metadata":{"_uuid":"4246dae2-55f3-4290-ae12-7d0e221adbb7","_cell_guid":"e2f77296-b382-40c2-bbc8-4b0c3c6f6ca5","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:18.870271Z","iopub.execute_input":"2021-11-22T12:42:18.870537Z","iopub.status.idle":"2021-11-22T12:42:19.058099Z","shell.execute_reply.started":"2021-11-22T12:42:18.870506Z","shell.execute_reply":"2021-11-22T12:42:19.057178Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Bar representation of week","metadata":{"_uuid":"7470443d-0b1c-4be2-ae50-b06132a0e079","_cell_guid":"a63021ae-bfdb-43bf-a6e0-f59d7b47c217","trusted":true}},{"cell_type":"code","source":"sns.countplot(x=\"week\",data=df).set(title=\"Total numbers of  game played in each week\")\nplt.xlabel(\"Week\",fontsize=15)\nplt.ylabel(\"Number of matches\",fontsize=15)\nplt.show()\nsns.set(rc={\"figure.figsize\":(16,4)})","metadata":{"_uuid":"ec4fb101-bbd7-4e01-85ce-15fdc654b1f3","_cell_guid":"9ca44a85-f5a2-4c12-adbf-195a21c46d02","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:19.05916Z","iopub.execute_input":"2021-11-22T12:42:19.059378Z","iopub.status.idle":"2021-11-22T12:42:19.343843Z","shell.execute_reply.started":"2021-11-22T12:42:19.059349Z","shell.execute_reply":"2021-11-22T12:42:19.342947Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.countplot(x=\"gameTimeEastern\", data=df, orient=\"h\").set(title=\"Number of matches at given time\")\nplt.xlabel(\"Gametime\",fontsize=15)\nplt.ylabel(\"Number of matches\",fontsize=15)\n\nplt.show()\nsns.set(rc={\"figure.figsize\":(16,8)})\n\n#### number of matches at given time","metadata":{"_uuid":"2373de66-4f86-40f6-87ee-b7ed025c4660","_cell_guid":"2e3c7d15-dba3-43c7-9120-27e106d8cec0","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:19.347449Z","iopub.execute_input":"2021-11-22T12:42:19.34787Z","iopub.status.idle":"2021-11-22T12:42:19.711606Z","shell.execute_reply.started":"2021-11-22T12:42:19.347825Z","shell.execute_reply":"2021-11-22T12:42:19.710807Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.countplot(x=\"visitorTeamAbbr\",data=df).set(title=\"No of matches visitor team played\")\nplt.xlabel(\"VisitorTeam\",fontsize=15)\nplt.ylabel(\"Number of matches\",fontsize=15)\nplt.show()\nsns.set()","metadata":{"_uuid":"b79dfcec-f6c4-491f-a46b-31b4af04d460","_cell_guid":"2c4165de-934c-4dbe-b6c4-fdacddabd8ca","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:19.712808Z","iopub.execute_input":"2021-11-22T12:42:19.713042Z","iopub.status.idle":"2021-11-22T12:42:20.231503Z","shell.execute_reply.started":"2021-11-22T12:42:19.713013Z","shell.execute_reply":"2021-11-22T12:42:20.230668Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Correlation and heatmap","metadata":{"_uuid":"1e6d03f9-d5c9-4dbd-aacd-e288bb4b04bc","_cell_guid":"10fe144a-bb70-4dd4-9d57-3518039ea355","trusted":true}},{"cell_type":"code","source":"corr=df.corr()\ncorr","metadata":{"_uuid":"06ad150c-bd08-4823-be98-31bfc25f19b1","_cell_guid":"079c73ce-ccab-4d68-a8fe-c0528beef2dc","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.232694Z","iopub.execute_input":"2021-11-22T12:42:20.232925Z","iopub.status.idle":"2021-11-22T12:42:20.245947Z","shell.execute_reply.started":"2021-11-22T12:42:20.232897Z","shell.execute_reply":"2021-11-22T12:42:20.245109Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.heatmap(corr, annot=True, linewidths=.4, cmap='YlGnBu_r')\nplt.show()\n\n#### heatmap tells about relevant features about data like negative value tells us that feature is irrelevant.\n#Colors also tell us that which features/columns are relevant for example blue tells us that feature is not important.","metadata":{"_uuid":"8052b5a6-c39a-47c4-b1f2-5b92b68c4448","_cell_guid":"68c13230-8e9e-43eb-81ca-99622dd63e48","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.247247Z","iopub.execute_input":"2021-11-22T12:42:20.248052Z","iopub.status.idle":"2021-11-22T12:42:20.54524Z","shell.execute_reply.started":"2021-11-22T12:42:20.248019Z","shell.execute_reply":"2021-11-22T12:42:20.544446Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Games played in each season","metadata":{"_uuid":"07c58b5f-6786-43ca-bb4c-c6bb6e8b6a26","_cell_guid":"4d96b741-1a70-464d-b31d-0a657199b6a2","trusted":true}},{"cell_type":"code","source":"exploda=(0,0.1,0)\ndf[\"season\"].value_counts().plot.pie(autopct=\"%1.1f%%\",explode=exploda,pctdistance=.3,shadow=True,labeldistance=.8).set(title=\"Percentage of matches played in every season\")\n\nplt.show()\n\n\n### Almost same amount of matches are played in every season","metadata":{"_uuid":"f52b8dfc-62b9-4edb-8022-8b211c5f1841","_cell_guid":"6a88383e-0259-4e79-b496-d8c8e6012df5","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.546557Z","iopub.execute_input":"2021-11-22T12:42:20.546786Z","iopub.status.idle":"2021-11-22T12:42:20.68716Z","shell.execute_reply.started":"2021-11-22T12:42:20.546755Z","shell.execute_reply":"2021-11-22T12:42:20.686588Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#  Players Data","metadata":{"_uuid":"e3ae61ba-7988-4c1e-b25a-7d3f89e69a15","_cell_guid":"501d1792-bb13-47fa-adac-789a0fdbb506","trusted":true}},{"cell_type":"code","source":"df1=pd.read_csv('../input/nfl-big-data-bowl-2022/players.csv')\ndf1","metadata":{"_uuid":"d667309a-4672-4e4f-9fab-9172c0c8d9dd","_cell_guid":"0c51185b-c693-4741-8c71-23f8e46d5a1c","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.688187Z","iopub.execute_input":"2021-11-22T12:42:20.688506Z","iopub.status.idle":"2021-11-22T12:42:20.714138Z","shell.execute_reply.started":"2021-11-22T12:42:20.688477Z","shell.execute_reply":"2021-11-22T12:42:20.713574Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.info()","metadata":{"_uuid":"98b06c9d-d100-4471-9b01-5e4aa07f590c","_cell_guid":"d7922c70-9cbb-4a8f-8d6f-7c7bae9857b8","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.715052Z","iopub.execute_input":"2021-11-22T12:42:20.715438Z","iopub.status.idle":"2021-11-22T12:42:20.730235Z","shell.execute_reply.started":"2021-11-22T12:42:20.715397Z","shell.execute_reply":"2021-11-22T12:42:20.72942Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.isnull()","metadata":{"_uuid":"0041c219-3ef9-4a4f-9092-9ab9221d1d12","_cell_guid":"6e5d177f-b0a9-4982-b1b4-944047b4af19","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.731617Z","iopub.execute_input":"2021-11-22T12:42:20.732227Z","iopub.status.idle":"2021-11-22T12:42:20.751019Z","shell.execute_reply.started":"2021-11-22T12:42:20.732193Z","shell.execute_reply":"2021-11-22T12:42:20.750441Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.isnull().sum()","metadata":{"_uuid":"30a692f3-378c-46dc-a21e-ec184dd8b207","_cell_guid":"4ac92f72-a6f6-4b0d-8816-8d7f9f9d002f","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.752003Z","iopub.execute_input":"2021-11-22T12:42:20.752767Z","iopub.status.idle":"2021-11-22T12:42:20.762101Z","shell.execute_reply.started":"2021-11-22T12:42:20.752731Z","shell.execute_reply":"2021-11-22T12:42:20.76129Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.dropna(inplace=True)\ndf1","metadata":{"_uuid":"53b7198b-0427-4ce4-b92f-361bcb7d66ac","_cell_guid":"bfe50404-6996-46ca-a087-789e9dc6bbfb","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.763451Z","iopub.execute_input":"2021-11-22T12:42:20.764348Z","iopub.status.idle":"2021-11-22T12:42:20.786199Z","shell.execute_reply.started":"2021-11-22T12:42:20.764304Z","shell.execute_reply":"2021-11-22T12:42:20.785466Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.isnull().sum()","metadata":{"_uuid":"59edcb24-ff96-48ee-920d-1578394e51d5","_cell_guid":"6f47bd32-4fd8-4556-8c11-62b34ec9779b","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.787613Z","iopub.execute_input":"2021-11-22T12:42:20.788295Z","iopub.status.idle":"2021-11-22T12:42:20.803459Z","shell.execute_reply.started":"2021-11-22T12:42:20.788248Z","shell.execute_reply":"2021-11-22T12:42:20.802473Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.nunique()","metadata":{"_uuid":"888a438b-be51-4edf-8917-7e07f81877fe","_cell_guid":"3e8af0c4-fbe1-4123-a247-00cf2a5be796","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.80473Z","iopub.execute_input":"2021-11-22T12:42:20.805181Z","iopub.status.idle":"2021-11-22T12:42:20.817355Z","shell.execute_reply.started":"2021-11-22T12:42:20.805139Z","shell.execute_reply":"2021-11-22T12:42:20.816731Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Rearranging columns Names","metadata":{"_uuid":"db7df9a5-31b4-418b-ace7-0b865a42929a","_cell_guid":"302fd10f-3f8c-4635-a3b4-2701ae1d3193","trusted":true}},{"cell_type":"code","source":"df1=df1[[\"nflId\",\"displayName\",\"birthDate\",\"height\",\"weight\",\"collegeName\",\"Position\"]]\ndf1","metadata":{"_uuid":"74e4bef0-be04-47c2-a349-053c6c7f91c4","_cell_guid":"3dc8bfd0-e8d5-49ec-974d-161d8442c7e8","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.818467Z","iopub.execute_input":"2021-11-22T12:42:20.819006Z","iopub.status.idle":"2021-11-22T12:42:20.837192Z","shell.execute_reply.started":"2021-11-22T12:42:20.818976Z","shell.execute_reply":"2021-11-22T12:42:20.836286Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1[\"height\"].unique()","metadata":{"_uuid":"aa2052f3-af48-4e3a-895e-4615bf952d58","_cell_guid":"f28b7c90-9fa5-4709-b164-0edcf888893a","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.83854Z","iopub.execute_input":"2021-11-22T12:42:20.838746Z","iopub.status.idle":"2021-11-22T12:42:20.851198Z","shell.execute_reply.started":"2021-11-22T12:42:20.838719Z","shell.execute_reply":"2021-11-22T12:42:20.850309Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.dtypes","metadata":{"_uuid":"e4d1d7e0-1f5b-47fe-9edf-613326063904","_cell_guid":"3db36434-b5ce-4612-ad04-3b82a031339d","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.852383Z","iopub.execute_input":"2021-11-22T12:42:20.852791Z","iopub.status.idle":"2021-11-22T12:42:20.862176Z","shell.execute_reply.started":"2021-11-22T12:42:20.852744Z","shell.execute_reply":"2021-11-22T12:42:20.86146Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1[\"height\"]=df1[\"height\"].astype(str)","metadata":{"_uuid":"f7e31861-52e3-44bc-84fa-7ee4709b6b62","_cell_guid":"e1d62187-4015-4f9e-8722-246d6c099ec9","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.863497Z","iopub.execute_input":"2021-11-22T12:42:20.864355Z","iopub.status.idle":"2021-11-22T12:42:20.874039Z","shell.execute_reply.started":"2021-11-22T12:42:20.86431Z","shell.execute_reply":"2021-11-22T12:42:20.87344Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1","metadata":{"_uuid":"f097ed01-6ce4-49f6-ba68-48b8bd399383","_cell_guid":"80b5f3e9-5315-4256-a261-863d05b0177b","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.875481Z","iopub.execute_input":"2021-11-22T12:42:20.87599Z","iopub.status.idle":"2021-11-22T12:42:20.896279Z","shell.execute_reply.started":"2021-11-22T12:42:20.875946Z","shell.execute_reply":"2021-11-22T12:42:20.895464Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\ndf1=df1.loc[df1[\"height\"]!=\"76\"]\ndf1","metadata":{"_uuid":"5a758d4d-6c4c-4d08-b9d9-d4daf6c643e6","_cell_guid":"d7ab4214-da13-4b03-8922-738744b04732","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.897862Z","iopub.execute_input":"2021-11-22T12:42:20.898463Z","iopub.status.idle":"2021-11-22T12:42:20.919028Z","shell.execute_reply.started":"2021-11-22T12:42:20.898418Z","shell.execute_reply":"2021-11-22T12:42:20.918354Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### **REMOVED ALL IRRELEVANT DATA FROM HEIGTH COLUMN**\n\ndeleted all these noisy number from height column \n[76', '75', '74','72', '71', '73', '70', '77', '78', '68', '66', '79', '69', '67']","metadata":{"_uuid":"6dd0dcba-9bdd-47c4-82c2-cbf71f0fb621","_cell_guid":"84ed64d9-4f00-40ec-94a5-b4e1202beba9","trusted":true}},{"cell_type":"code","source":"df1=df1.loc[df1[\"height\"]!=\"75\"]\ndfa=df1.loc[df1[\"height\"]!=\"74\"]\ndfb=dfa.loc[dfa[\"height\"]!=\"72\"]\ndfc=dfb.loc[dfb[\"height\"]!=\"71\"]\ndfd=dfc.loc[dfc[\"height\"]!=\"73\"]\ndff=dfd.loc[dfd[\"height\"]!=\"70\"]\ndfg=dff.loc[dff[\"height\"]!=\"67\"]\ndfh=dfg.loc[dfg[\"height\"]!=\"77\"]\ndfi=dfh.loc[dfh[\"height\"]!=\"78\"]\ndfj=dfi.loc[dfi[\"height\"]!=\"68\"]\ndfk=dfj.loc[dfj[\"height\"]!=\"69\"]\ndfl=dfk.loc[dfk[\"height\"]!=\"66\"]\ndf2=dfl.loc[dfl[\"height\"]!=\"79\"]\ndf2","metadata":{"_uuid":"9c30ae62-c119-4d1b-a537-73a5d44e3508","_cell_guid":"6f2361bd-5270-4cb1-8850-27a369d571dd","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.920433Z","iopub.execute_input":"2021-11-22T12:42:20.920894Z","iopub.status.idle":"2021-11-22T12:42:20.961146Z","shell.execute_reply.started":"2021-11-22T12:42:20.920851Z","shell.execute_reply":"2021-11-22T12:42:20.960316Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2[\"height\"].unique() # all irrelevant has been removed from the dataframe","metadata":{"_uuid":"3cce5d46-6883-4905-9d68-454fb0ced05b","_cell_guid":"62b3c6cb-9c7c-4048-bda5-51bdbfedde8f","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.962783Z","iopub.execute_input":"2021-11-22T12:42:20.963076Z","iopub.status.idle":"2021-11-22T12:42:20.970189Z","shell.execute_reply.started":"2021-11-22T12:42:20.963035Z","shell.execute_reply":"2021-11-22T12:42:20.969444Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## **RESETING INDEX**","metadata":{"_uuid":"deca35be-fd74-47fd-a653-c6eebf6edc3c","_cell_guid":"c53ddd74-688b-4822-990d-a0d13648cc41","trusted":true}},{"cell_type":"code","source":"df3_re=df2.reset_index()\ndf3=df3_re.drop(\"index\",axis=1)","metadata":{"_uuid":"138f77e2-391f-483c-b17b-62a71613bd03","_cell_guid":"1a99d27d-e27b-4bf1-937d-6ed9fbe239a6","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.971818Z","iopub.execute_input":"2021-11-22T12:42:20.972267Z","iopub.status.idle":"2021-11-22T12:42:20.980831Z","shell.execute_reply.started":"2021-11-22T12:42:20.972225Z","shell.execute_reply":"2021-11-22T12:42:20.980076Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### **CONVERTING HEIGHT INTO CENTIMETER**","metadata":{"_uuid":"eb7f5a9e-53ed-48d0-8dc8-e9c7f648b8f4","_cell_guid":"9953c11a-b6fa-4935-9768-55a8c307ccb2","trusted":true}},{"cell_type":"code","source":"height=[]\nfor i in range(len(df3[\"height\"])):\n    x=df3[\"height\"][i].split(\"-\")\n    feet=int(x[0])\n    inches=int(x[1])\n    height_cm=round((feet*12+inches)*2.54,1)\n    height.append(height_cm)\n    \n    \n   #### converted all height value into its centimeter.","metadata":{"_uuid":"540e0a72-4ff7-4dea-8c62-0104f67aa923","_cell_guid":"916436c4-8684-465a-a05a-fbaa5b7fb0dc","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:20.981944Z","iopub.execute_input":"2021-11-22T12:42:20.98233Z","iopub.status.idle":"2021-11-22T12:42:21.016702Z","shell.execute_reply.started":"2021-11-22T12:42:20.982298Z","shell.execute_reply":"2021-11-22T12:42:21.015824Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df3[\"height\"]=height\ndf3","metadata":{"_uuid":"b4fe4a6f-b7d7-4b71-9c43-9d7bc7c0db0e","_cell_guid":"4045fc0f-875b-4873-825f-8d3a577633c1","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:21.01781Z","iopub.execute_input":"2021-11-22T12:42:21.018055Z","iopub.status.idle":"2021-11-22T12:42:21.041178Z","shell.execute_reply.started":"2021-11-22T12:42:21.01802Z","shell.execute_reply":"2021-11-22T12:42:21.040332Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Droping Irrelevant Columns from dataframe","metadata":{"_uuid":"3d74248d-eac5-4844-852f-4d6742c4cc41","_cell_guid":"1d9b4671-6c21-4525-9270-a46b7002fe43","trusted":true}},{"cell_type":"code","source":"df3.drop([\"collegeName\",\"nflId\"],axis=1,inplace=True)\ndf3\n\n###Droped columns: collegeName and nflId which seems irrelevant","metadata":{"_uuid":"c87d8e37-ff18-4bcd-af74-70a55c0952a7","_cell_guid":"7b815932-766d-44f6-9b7c-806dcf609699","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:21.04243Z","iopub.execute_input":"2021-11-22T12:42:21.042659Z","iopub.status.idle":"2021-11-22T12:42:21.059768Z","shell.execute_reply.started":"2021-11-22T12:42:21.04263Z","shell.execute_reply":"2021-11-22T12:42:21.059209Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df3[\"height\"].unique()","metadata":{"_uuid":"f57fd98a-143b-4b29-ac7a-44d51d7baccb","_cell_guid":"1990ac9a-22f4-4223-afa4-80d83970a1e1","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:21.061014Z","iopub.execute_input":"2021-11-22T12:42:21.061242Z","iopub.status.idle":"2021-11-22T12:42:21.074179Z","shell.execute_reply.started":"2021-11-22T12:42:21.061213Z","shell.execute_reply":"2021-11-22T12:42:21.0732Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df3[\"weight\"].value_counts().head(35).plot(kind=\"bar\")\nplt.ylabel(\"Number of Players\",fontsize=16)\nplt.xlabel(\"Weight\", fontsize=16)\nplt.title(\"Weight Distribution of player\",fontsize=20)\nplt.show()\n\n# if we consider weight which has more than 40 player than we can calculate average ideal weight of player.","metadata":{"_uuid":"5362e1be-e1eb-41c7-8433-fe4f05e2acfb","_cell_guid":"fb90f72b-3896-4537-8da9-f6b15a4d6164","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:21.075691Z","iopub.execute_input":"2021-11-22T12:42:21.076646Z","iopub.status.idle":"2021-11-22T12:42:21.613271Z","shell.execute_reply.started":"2021-11-22T12:42:21.076599Z","shell.execute_reply":"2021-11-22T12:42:21.612604Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.relplot(x=\"height\",y=\"Position\",data=df3)\nplt.title(\"Relation between height and Position\",fontsize=20)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2021-11-22T12:48:25.161978Z","iopub.execute_input":"2021-11-22T12:48:25.162278Z","iopub.status.idle":"2021-11-22T12:48:25.66056Z","shell.execute_reply.started":"2021-11-22T12:48:25.162247Z","shell.execute_reply":"2021-11-22T12:48:25.659735Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df3[\"Position\"].unique()","metadata":{"_uuid":"1708d9f8-7c3d-474b-aa0b-eb0ad494e19a","_cell_guid":"6d91e201-1201-4c84-9f3c-c534ddb69117","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:21.614348Z","iopub.execute_input":"2021-11-22T12:42:21.614675Z","iopub.status.idle":"2021-11-22T12:42:21.620799Z","shell.execute_reply.started":"2021-11-22T12:42:21.614646Z","shell.execute_reply":"2021-11-22T12:42:21.619899Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df3.groupby(\"Position\")[\"height\"].value_counts().head(16).plot(kind=\"bar\")\nplt.title(\"Position of a player according to height\",fontsize=20)\nplt.ylabel(\"Number of players\",fontsize=16)\nplt.xlabel(\"Position & Height\",fontsize=16)\nplt.show()\n\n\n### Best height for CB(centre back) is between 180 cm to 185 cm (average=182.5cm) according to graph.","metadata":{"_uuid":"3b4be09b-dbc8-4449-b2ce-ccc1f03bf722","_cell_guid":"c2547e6d-09dd-4246-b589-b4047c39f050","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:21.627056Z","iopub.execute_input":"2021-11-22T12:42:21.627292Z","iopub.status.idle":"2021-11-22T12:42:22.012315Z","shell.execute_reply.started":"2021-11-22T12:42:21.627265Z","shell.execute_reply":"2021-11-22T12:42:22.011639Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{"_uuid":"b3cce390-45c4-43fe-9173-990b4caae711","_cell_guid":"e7df8d35-a160-4d37-9d17-55a38ba5afc5","trusted":true}},{"cell_type":"code","source":"df3.groupby(\"Position\")[\"weight\"].value_counts().head(50).plot(kind=\"bar\")\nplt.title(\"Position of a Player according to weight\",fontsize=20)\nplt.xlabel(\"Position & Weight\",fontsize=16)\nplt.ylabel(\"Number of player\",fontsize=16)\nplt.show()\n\n### we can say that ideal weight for CB( centre back) position is between 190 to 210(average=200)\n#if we consider player greater than 10.","metadata":{"_uuid":"c07e3951-b30a-47ed-8676-570c16fd1e1a","_cell_guid":"70ebf000-3c3d-4b84-8530-4d5a90ccffaa","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:22.013327Z","iopub.execute_input":"2021-11-22T12:42:22.014137Z","iopub.status.idle":"2021-11-22T12:42:23.21842Z","shell.execute_reply.started":"2021-11-22T12:42:22.014094Z","shell.execute_reply":"2021-11-22T12:42:23.217569Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Correlation and Heatmap**","metadata":{}},{"cell_type":"code","source":"corr=df3.corr()\ncorr","metadata":{"execution":{"iopub.status.busy":"2021-11-22T12:42:23.22001Z","iopub.execute_input":"2021-11-22T12:42:23.220342Z","iopub.status.idle":"2021-11-22T12:42:23.231675Z","shell.execute_reply.started":"2021-11-22T12:42:23.220277Z","shell.execute_reply":"2021-11-22T12:42:23.230887Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.heatmap(corr, annot=True, linewidths=.4,color=\"c\")\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2021-11-22T12:42:23.233026Z","iopub.execute_input":"2021-11-22T12:42:23.233278Z","iopub.status.idle":"2021-11-22T12:42:23.502229Z","shell.execute_reply.started":"2021-11-22T12:42:23.233248Z","shell.execute_reply":"2021-11-22T12:42:23.501466Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{"_uuid":"181e3340-b412-43d7-bc27-fe28738ca4f1","_cell_guid":"cea05ac3-c127-4e15-8a5b-5eddf2ffb174","trusted":true}},{"cell_type":"markdown","source":"#  **Plays Data**","metadata":{"_uuid":"d31e3028-a937-4ec4-8a2d-4c628c4bd1d0","_cell_guid":"d4ebda2b-0ce5-42bc-829e-9a74f5423424","trusted":true}},{"cell_type":"code","source":"df4=pd.read_csv(\"../input/nfl-big-data-bowl-2022/plays.csv\")\ndf4.tail()","metadata":{"_uuid":"93b87505-85fa-4983-8424-ed399d3653d4","_cell_guid":"4f4b384a-c536-4f00-99b8-063995328aa9","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:23.503703Z","iopub.execute_input":"2021-11-22T12:42:23.504089Z","iopub.status.idle":"2021-11-22T12:42:23.634817Z","shell.execute_reply.started":"2021-11-22T12:42:23.504045Z","shell.execute_reply":"2021-11-22T12:42:23.634048Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4.shape","metadata":{"_uuid":"91a09b13-0022-4ac0-acc4-6d0ebad55a0e","_cell_guid":"039cccc4-fb7a-4c82-9c9a-f67dda37bffe","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:23.635941Z","iopub.execute_input":"2021-11-22T12:42:23.636166Z","iopub.status.idle":"2021-11-22T12:42:23.642293Z","shell.execute_reply.started":"2021-11-22T12:42:23.63614Z","shell.execute_reply":"2021-11-22T12:42:23.641441Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4.columns","metadata":{"_uuid":"9cf3db98-0031-4df7-9c1c-e21f4b1114c3","_cell_guid":"ff1321e1-c73c-43a4-88dc-0c9ee8ec983f","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:23.643443Z","iopub.execute_input":"2021-11-22T12:42:23.643666Z","iopub.status.idle":"2021-11-22T12:42:23.655663Z","shell.execute_reply.started":"2021-11-22T12:42:23.643639Z","shell.execute_reply":"2021-11-22T12:42:23.65506Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4.drop(\"penaltyJerseyNumbers\",axis=1,inplace=True)\ndf4.columns","metadata":{"_uuid":"4bb9855c-cc29-43e7-8fc5-fc5b3d97456e","_cell_guid":"56b18d77-7204-430b-b4b4-5bbc0f267223","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:23.656547Z","iopub.execute_input":"2021-11-22T12:42:23.657042Z","iopub.status.idle":"2021-11-22T12:42:23.6719Z","shell.execute_reply.started":"2021-11-22T12:42:23.657004Z","shell.execute_reply":"2021-11-22T12:42:23.67132Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### (Cleaning)Deleted all columns with NAN values","metadata":{"_uuid":"a6e7f72a-3b90-41aa-84b4-7708442d033c","_cell_guid":"6c4cadc7-eb5c-4770-9674-c44badce64a5","trusted":true}},{"cell_type":"code","source":"df4.dropna(axis=1,inplace=True)","metadata":{"_uuid":"90ace503-ff13-48f7-bd62-309146922fe0","_cell_guid":"ae3ccfee-bf8f-4b0d-a43d-2ce2579b4937","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:23.672799Z","iopub.execute_input":"2021-11-22T12:42:23.673272Z","iopub.status.idle":"2021-11-22T12:42:23.701005Z","shell.execute_reply.started":"2021-11-22T12:42:23.673241Z","shell.execute_reply":"2021-11-22T12:42:23.700183Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4.isnull().sum()\n#Cleaning data","metadata":{"_uuid":"7f386ef2-d3e3-47b8-9186-fe9a476beabb","_cell_guid":"1869328e-87cf-4f15-8316-4e5ba72ff3da","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:23.702301Z","iopub.execute_input":"2021-11-22T12:42:23.702533Z","iopub.status.idle":"2021-11-22T12:42:23.723109Z","shell.execute_reply.started":"2021-11-22T12:42:23.702505Z","shell.execute_reply":"2021-11-22T12:42:23.722207Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4","metadata":{"_uuid":"08b5907e-fd12-45ca-8088-b2a434a87f41","_cell_guid":"2fdc7f7d-1fdf-4a51-94a5-4fe745d48a40","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:23.724107Z","iopub.execute_input":"2021-11-22T12:42:23.724315Z","iopub.status.idle":"2021-11-22T12:42:23.746486Z","shell.execute_reply.started":"2021-11-22T12:42:23.724289Z","shell.execute_reply":"2021-11-22T12:42:23.745849Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4.columns","metadata":{"_uuid":"04d009bc-df90-45bc-9878-e51e01475c54","_cell_guid":"a562c4ed-7994-483a-bcd8-fc5b5dada0ab","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:23.747636Z","iopub.execute_input":"2021-11-22T12:42:23.748361Z","iopub.status.idle":"2021-11-22T12:42:23.75422Z","shell.execute_reply.started":"2021-11-22T12:42:23.748323Z","shell.execute_reply":"2021-11-22T12:42:23.753517Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4[\"specialTeamsPlayType\"].value_counts().plot(kind=\"bar\",color=\"c\")\nplt.title(\"Special Teams Play Type\",fontsize=20)\nplt.xlabel(\"Play types\",fontsize=16)\nplt.ylabel(\"Counts\",fontsize=16)\nplt.show()","metadata":{"_uuid":"35b86e11-31d6-4d1e-82d3-3c018710a946","_cell_guid":"c8a99552-404d-42ea-9ede-91eba8d55fcd","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2021-11-22T12:42:23.755489Z","iopub.execute_input":"2021-11-22T12:42:23.755706Z","iopub.status.idle":"2021-11-22T12:42:24.019823Z","shell.execute_reply.started":"2021-11-22T12:42:23.75568Z","shell.execute_reply":"2021-11-22T12:42:24.019052Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Deleting Irrelevant Columns**","metadata":{}},{"cell_type":"code","source":"df4.drop(columns=['gameId', 'playId'],axis=1,inplace=True)\ndf4.head(10)","metadata":{"execution":{"iopub.status.busy":"2021-11-22T12:42:24.021023Z","iopub.execute_input":"2021-11-22T12:42:24.021283Z","iopub.status.idle":"2021-11-22T12:42:24.041254Z","shell.execute_reply.started":"2021-11-22T12:42:24.021231Z","shell.execute_reply":"2021-11-22T12:42:24.040684Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4[\"possessionTeam\"].value_counts().plot(kind=\"bar\",color=\"r\")\nplt.title(\"PossessionTeam\",fontsize=20)\nplt.xlabel(\"Team\",fontsize=16,color=\"k\")\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2021-11-22T12:42:24.042573Z","iopub.execute_input":"2021-11-22T12:42:24.042806Z","iopub.status.idle":"2021-11-22T12:42:24.699179Z","shell.execute_reply.started":"2021-11-22T12:42:24.042777Z","shell.execute_reply":"2021-11-22T12:42:24.698304Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4[\"specialTeamsResult\"].value_counts().plot(kind=\"bar\",color=\"g\")\nplt.title(\"Special Teams Result\",fontsize=20)\nplt.xlabel(\"Play Types\",fontsize=16,color=\"k\")\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2021-11-22T12:42:24.70068Z","iopub.execute_input":"2021-11-22T12:42:24.701082Z","iopub.status.idle":"2021-11-22T12:42:25.026501Z","shell.execute_reply.started":"2021-11-22T12:42:24.701036Z","shell.execute_reply":"2021-11-22T12:42:25.025612Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Relation between Specialteam, it's play types and TeamResult","metadata":{}},{"cell_type":"code","source":"sns.scatterplot(x=\"possessionTeam\", y=\"specialTeamsPlayType\",hue=\"specialTeamsResult\",data=df4)\nplt.title(\"Relation between team, it's play types and TeamResult\",fontsize=20)\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2021-11-22T12:42:25.027722Z","iopub.execute_input":"2021-11-22T12:42:25.027973Z","iopub.status.idle":"2021-11-22T12:42:27.150349Z","shell.execute_reply.started":"2021-11-22T12:42:25.027943Z","shell.execute_reply":"2021-11-22T12:42:27.149372Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Correlation and Heatmap","metadata":{}},{"cell_type":"code","source":"corr=df4.corr()\ncorr","metadata":{"execution":{"iopub.status.busy":"2021-11-22T12:42:27.151631Z","iopub.execute_input":"2021-11-22T12:42:27.15193Z","iopub.status.idle":"2021-11-22T12:42:27.176762Z","shell.execute_reply.started":"2021-11-22T12:42:27.151891Z","shell.execute_reply":"2021-11-22T12:42:27.175875Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.heatmap(corr,annot=True, linewidths=.4,color=\"c\")\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2021-11-22T12:42:27.1778Z","iopub.execute_input":"2021-11-22T12:42:27.178215Z","iopub.status.idle":"2021-11-22T12:42:27.842244Z","shell.execute_reply.started":"2021-11-22T12:42:27.17818Z","shell.execute_reply":"2021-11-22T12:42:27.841333Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{"_uuid":"7776ef99-19be-477e-a3b7-75aa1ec406cc","_cell_guid":"f36b0d8f-d063-4557-b80b-32e329ff5177","trusted":true}}]}