{"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":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# import all libraryies","metadata":{}},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n%matplotlib inline\nimport seaborn as sns","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:03:53.414631Z","iopub.execute_input":"2021-12-24T12:03:53.415498Z","iopub.status.idle":"2021-12-24T12:03:54.832523Z","shell.execute_reply.started":"2021-12-24T12:03:53.415389Z","shell.execute_reply":"2021-12-24T12:03:54.831128Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Read the dataset","metadata":{}},{"cell_type":"code","source":"players=pd.read_csv('../input/nfl-big-data-bowl-2022/players.csv')","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:04:00.024818Z","iopub.execute_input":"2021-12-24T12:04:00.025459Z","iopub.status.idle":"2021-12-24T12:04:00.056274Z","shell.execute_reply.started":"2021-12-24T12:04:00.025397Z","shell.execute_reply":"2021-12-24T12:04:00.05542Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"players.head(2)","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:06:06.76111Z","iopub.execute_input":"2021-12-24T12:06:06.762342Z","iopub.status.idle":"2021-12-24T12:06:06.790836Z","shell.execute_reply.started":"2021-12-24T12:06:06.762295Z","shell.execute_reply":"2021-12-24T12:06:06.789648Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays = pd.read_csv(\"../input/nfl-big-data-bowl-2022/plays.csv\")","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:06:16.425526Z","iopub.execute_input":"2021-12-24T12:06:16.425917Z","iopub.status.idle":"2021-12-24T12:06:16.65522Z","shell.execute_reply.started":"2021-12-24T12:06:16.425879Z","shell.execute_reply":"2021-12-24T12:06:16.654332Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays.head(2)","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:06:19.785141Z","iopub.execute_input":"2021-12-24T12:06:19.785514Z","iopub.status.idle":"2021-12-24T12:06:19.818034Z","shell.execute_reply.started":"2021-12-24T12:06:19.78548Z","shell.execute_reply":"2021-12-24T12:06:19.817316Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games = pd.read_csv(\"../input/nfl-big-data-bowl-2022/games.csv\")","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:06:37.372214Z","iopub.execute_input":"2021-12-24T12:06:37.373015Z","iopub.status.idle":"2021-12-24T12:06:37.395625Z","shell.execute_reply.started":"2021-12-24T12:06:37.372955Z","shell.execute_reply":"2021-12-24T12:06:37.394595Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games.head(2)","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:08:34.611313Z","iopub.execute_input":"2021-12-24T12:08:34.611921Z","iopub.status.idle":"2021-12-24T12:08:34.625112Z","shell.execute_reply.started":"2021-12-24T12:08:34.611861Z","shell.execute_reply":"2021-12-24T12:08:34.62421Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PFFScoutingData = pd.read_csv('../input/nfl-big-data-bowl-2022/PFFScoutingData.csv')","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:08:48.131013Z","iopub.execute_input":"2021-12-24T12:08:48.132163Z","iopub.status.idle":"2021-12-24T12:08:48.24829Z","shell.execute_reply.started":"2021-12-24T12:08:48.132115Z","shell.execute_reply":"2021-12-24T12:08:48.246965Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PFFScoutingData.head(2)","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:08:51.574611Z","iopub.execute_input":"2021-12-24T12:08:51.575558Z","iopub.status.idle":"2021-12-24T12:08:51.600206Z","shell.execute_reply.started":"2021-12-24T12:08:51.575517Z","shell.execute_reply":"2021-12-24T12:08:51.599117Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# dataset information","metadata":{}},{"cell_type":"code","source":"# players info and eda","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"players.info()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:08:59.220212Z","iopub.execute_input":"2021-12-24T12:08:59.220507Z","iopub.status.idle":"2021-12-24T12:08:59.251892Z","shell.execute_reply.started":"2021-12-24T12:08:59.220475Z","shell.execute_reply":"2021-12-24T12:08:59.251104Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"players.shape","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:09:05.389963Z","iopub.execute_input":"2021-12-24T12:09:05.390417Z","iopub.status.idle":"2021-12-24T12:09:05.396576Z","shell.execute_reply.started":"2021-12-24T12:09:05.390382Z","shell.execute_reply":"2021-12-24T12:09:05.395295Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"players.describe()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:09:08.080157Z","iopub.execute_input":"2021-12-24T12:09:08.080535Z","iopub.status.idle":"2021-12-24T12:09:08.10576Z","shell.execute_reply.started":"2021-12-24T12:09:08.0805Z","shell.execute_reply":"2021-12-24T12:09:08.105033Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"players.dropna(inplace=True)","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:09:30.114511Z","iopub.execute_input":"2021-12-24T12:09:30.114809Z","iopub.status.idle":"2021-12-24T12:09:30.126113Z","shell.execute_reply.started":"2021-12-24T12:09:30.114779Z","shell.execute_reply":"2021-12-24T12:09:30.124943Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"players.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:09:43.74591Z","iopub.execute_input":"2021-12-24T12:09:43.746283Z","iopub.status.idle":"2021-12-24T12:09:43.758606Z","shell.execute_reply.started":"2021-12-24T12:09:43.746229Z","shell.execute_reply":"2021-12-24T12:09:43.75775Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"players.duplicated().sum()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:10:13.635245Z","iopub.execute_input":"2021-12-24T12:10:13.635687Z","iopub.status.idle":"2021-12-24T12:10:13.649371Z","shell.execute_reply.started":"2021-12-24T12:10:13.635655Z","shell.execute_reply":"2021-12-24T12:10:13.648529Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plays info and eda","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays.info()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:10:19.540297Z","iopub.execute_input":"2021-12-24T12:10:19.540963Z","iopub.status.idle":"2021-12-24T12:10:19.578397Z","shell.execute_reply.started":"2021-12-24T12:10:19.540914Z","shell.execute_reply":"2021-12-24T12:10:19.576899Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays.shape","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:10:25.879676Z","iopub.execute_input":"2021-12-24T12:10:25.880253Z","iopub.status.idle":"2021-12-24T12:10:25.887808Z","shell.execute_reply.started":"2021-12-24T12:10:25.88021Z","shell.execute_reply":"2021-12-24T12:10:25.886874Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays.describe()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:10:30.729746Z","iopub.execute_input":"2021-12-24T12:10:30.730128Z","iopub.status.idle":"2021-12-24T12:10:30.804799Z","shell.execute_reply.started":"2021-12-24T12:10:30.730093Z","shell.execute_reply":"2021-12-24T12:10:30.803557Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays.drop(columns=['kickerId','kickBlockerId', 'penaltyCodes', 'penaltyJerseyNumbers', 'penaltyYards', 'passResult', 'returnerId', 'yardlineSide','kickReturnYardage','kickLength'], inplace=True)","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:10:36.695364Z","iopub.execute_input":"2021-12-24T12:10:36.695654Z","iopub.status.idle":"2021-12-24T12:10:36.704313Z","shell.execute_reply.started":"2021-12-24T12:10:36.695625Z","shell.execute_reply":"2021-12-24T12:10:36.703166Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:10:40.825019Z","iopub.execute_input":"2021-12-24T12:10:40.825363Z","iopub.status.idle":"2021-12-24T12:10:40.850348Z","shell.execute_reply.started":"2021-12-24T12:10:40.825326Z","shell.execute_reply":"2021-12-24T12:10:40.848942Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays.duplicated().sum()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:10:46.534739Z","iopub.execute_input":"2021-12-24T12:10:46.535747Z","iopub.status.idle":"2021-12-24T12:10:46.56832Z","shell.execute_reply.started":"2021-12-24T12:10:46.535689Z","shell.execute_reply":"2021-12-24T12:10:46.567273Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#games info and eda","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games.info()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:10:52.124318Z","iopub.execute_input":"2021-12-24T12:10:52.125014Z","iopub.status.idle":"2021-12-24T12:10:52.140508Z","shell.execute_reply.started":"2021-12-24T12:10:52.124959Z","shell.execute_reply":"2021-12-24T12:10:52.139532Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games.duplicated().sum()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:10:55.918963Z","iopub.execute_input":"2021-12-24T12:10:55.919258Z","iopub.status.idle":"2021-12-24T12:10:55.931147Z","shell.execute_reply.started":"2021-12-24T12:10:55.919222Z","shell.execute_reply":"2021-12-24T12:10:55.930075Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games.shape","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:11:01.760653Z","iopub.execute_input":"2021-12-24T12:11:01.761021Z","iopub.status.idle":"2021-12-24T12:11:01.768447Z","shell.execute_reply.started":"2021-12-24T12:11:01.760987Z","shell.execute_reply":"2021-12-24T12:11:01.767223Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games.describe()\n","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:11:07.384953Z","iopub.execute_input":"2021-12-24T12:11:07.385385Z","iopub.status.idle":"2021-12-24T12:11:07.412298Z","shell.execute_reply.started":"2021-12-24T12:11:07.385353Z","shell.execute_reply":"2021-12-24T12:11:07.410794Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:11:13.645564Z","iopub.execute_input":"2021-12-24T12:11:13.645929Z","iopub.status.idle":"2021-12-24T12:11:13.658526Z","shell.execute_reply.started":"2021-12-24T12:11:13.645893Z","shell.execute_reply":"2021-12-24T12:11:13.657269Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#PFFScoutingData and eda","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PFFScoutingData.info()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:11:27.780381Z","iopub.execute_input":"2021-12-24T12:11:27.780741Z","iopub.status.idle":"2021-12-24T12:11:27.821573Z","shell.execute_reply.started":"2021-12-24T12:11:27.780705Z","shell.execute_reply":"2021-12-24T12:11:27.820062Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PFFScoutingData.shape","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:11:34.155791Z","iopub.execute_input":"2021-12-24T12:11:34.156373Z","iopub.status.idle":"2021-12-24T12:11:34.163904Z","shell.execute_reply.started":"2021-12-24T12:11:34.156335Z","shell.execute_reply":"2021-12-24T12:11:34.162965Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#data visulize","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games_plays = pd.merge(games, plays, on='gameId')","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:12:12.845769Z","iopub.execute_input":"2021-12-24T12:12:12.846585Z","iopub.status.idle":"2021-12-24T12:12:12.885129Z","shell.execute_reply.started":"2021-12-24T12:12:12.846526Z","shell.execute_reply":"2021-12-24T12:12:12.884008Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games.head()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:12:25.154714Z","iopub.execute_input":"2021-12-24T12:12:25.155068Z","iopub.status.idle":"2021-12-24T12:12:25.170536Z","shell.execute_reply.started":"2021-12-24T12:12:25.155035Z","shell.execute_reply":"2021-12-24T12:12:25.169472Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games_plays.season.value_counts().plot(kind='bar', figsize=(10,6))\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:12:34.586607Z","iopub.execute_input":"2021-12-24T12:12:34.586934Z","iopub.status.idle":"2021-12-24T12:12:34.856736Z","shell.execute_reply.started":"2021-12-24T12:12:34.586902Z","shell.execute_reply":"2021-12-24T12:12:34.855501Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"players.collegeName.value_counts()\n","metadata":{"execution":{"iopub.status.busy":"2021-12-24T12:12:41.769945Z","iopub.execute_input":"2021-12-24T12:12:41.770254Z","iopub.status.idle":"2021-12-24T12:12:41.781394Z","shell.execute_reply.started":"2021-12-24T12:12:41.770225Z","shell.execute_reply":"2021-12-24T12:12:41.780265Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}