{"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":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-09-25T06:10:50.658014Z","iopub.execute_input":"2021-09-25T06:10:50.65869Z","iopub.status.idle":"2021-09-25T06:10:50.671711Z","shell.execute_reply.started":"2021-09-25T06:10:50.65864Z","shell.execute_reply":"2021-09-25T06:10:50.670399Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:10:50.676053Z","iopub.execute_input":"2021-09-25T06:10:50.676352Z","iopub.status.idle":"2021-09-25T06:10:50.68053Z","shell.execute_reply.started":"2021-09-25T06:10:50.676291Z","shell.execute_reply":"2021-09-25T06:10:50.679759Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv('../input/nfl-big-data-bowl-2022/games.csv')","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:10:50.681763Z","iopub.execute_input":"2021-09-25T06:10:50.682152Z","iopub.status.idle":"2021-09-25T06:10:50.707977Z","shell.execute_reply.started":"2021-09-25T06:10:50.682123Z","shell.execute_reply":"2021-09-25T06:10:50.706785Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:10:50.712333Z","iopub.execute_input":"2021-09-25T06:10:50.712612Z","iopub.status.idle":"2021-09-25T06:10:50.737757Z","shell.execute_reply.started":"2021-09-25T06:10:50.712583Z","shell.execute_reply":"2021-09-25T06:10:50.736983Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:10:50.738948Z","iopub.execute_input":"2021-09-25T06:10:50.73974Z","iopub.status.idle":"2021-09-25T06:10:50.7516Z","shell.execute_reply.started":"2021-09-25T06:10:50.739679Z","shell.execute_reply":"2021-09-25T06:10:50.750456Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:10:50.753089Z","iopub.execute_input":"2021-09-25T06:10:50.753883Z","iopub.status.idle":"2021-09-25T06:10:50.765347Z","shell.execute_reply.started":"2021-09-25T06:10:50.753774Z","shell.execute_reply":"2021-09-25T06:10:50.763974Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:10:50.767094Z","iopub.execute_input":"2021-09-25T06:10:50.767662Z","iopub.status.idle":"2021-09-25T06:10:50.778618Z","shell.execute_reply.started":"2021-09-25T06:10:50.767615Z","shell.execute_reply":"2021-09-25T06:10:50.777458Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1 =pd.read_csv('../input/nfl-big-data-bowl-2022/tracking2020.csv')","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:10:50.7805Z","iopub.execute_input":"2021-09-25T06:10:50.780843Z","iopub.status.idle":"2021-09-25T06:11:32.329729Z","shell.execute_reply.started":"2021-09-25T06:10:50.780799Z","shell.execute_reply":"2021-09-25T06:11:32.32897Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.head()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:32.331697Z","iopub.execute_input":"2021-09-25T06:11:32.332303Z","iopub.status.idle":"2021-09-25T06:11:32.357399Z","shell.execute_reply.started":"2021-09-25T06:11:32.332259Z","shell.execute_reply":"2021-09-25T06:11:32.35655Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.shape","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:32.360596Z","iopub.execute_input":"2021-09-25T06:11:32.360961Z","iopub.status.idle":"2021-09-25T06:11:32.36613Z","shell.execute_reply.started":"2021-09-25T06:11:32.360933Z","shell.execute_reply":"2021-09-25T06:11:32.365601Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:32.366935Z","iopub.execute_input":"2021-09-25T06:11:32.367452Z","iopub.status.idle":"2021-09-25T06:11:40.226013Z","shell.execute_reply.started":"2021-09-25T06:11:32.36742Z","shell.execute_reply":"2021-09-25T06:11:40.224942Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.o.median()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.227171Z","iopub.execute_input":"2021-09-25T06:11:40.227424Z","iopub.status.idle":"2021-09-25T06:11:40.311269Z","shell.execute_reply.started":"2021-09-25T06:11:40.227397Z","shell.execute_reply":"2021-09-25T06:11:40.31037Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.dir.mean()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.312708Z","iopub.execute_input":"2021-09-25T06:11:40.313241Z","iopub.status.idle":"2021-09-25T06:11:40.33895Z","shell.execute_reply.started":"2021-09-25T06:11:40.313211Z","shell.execute_reply":"2021-09-25T06:11:40.338157Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.dir.median()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.340058Z","iopub.execute_input":"2021-09-25T06:11:40.340365Z","iopub.status.idle":"2021-09-25T06:11:40.421878Z","shell.execute_reply.started":"2021-09-25T06:11:40.340329Z","shell.execute_reply":"2021-09-25T06:11:40.420984Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.o.mean()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.423008Z","iopub.execute_input":"2021-09-25T06:11:40.423225Z","iopub.status.idle":"2021-09-25T06:11:40.448299Z","shell.execute_reply.started":"2021-09-25T06:11:40.423199Z","shell.execute_reply":"2021-09-25T06:11:40.44748Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df2= df1.o.fillna(df1.o.mean())","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.449537Z","iopub.execute_input":"2021-09-25T06:11:40.449773Z","iopub.status.idle":"2021-09-25T06:11:40.513087Z","shell.execute_reply.started":"2021-09-25T06:11:40.449735Z","shell.execute_reply":"2021-09-25T06:11:40.512381Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df3 = df1.dir.fillna(df1.dir.mean())","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.514377Z","iopub.execute_input":"2021-09-25T06:11:40.514617Z","iopub.status.idle":"2021-09-25T06:11:40.577705Z","shell.execute_reply.started":"2021-09-25T06:11:40.514591Z","shell.execute_reply":"2021-09-25T06:11:40.576805Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.nflId.mean()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.578983Z","iopub.execute_input":"2021-09-25T06:11:40.579256Z","iopub.status.idle":"2021-09-25T06:11:40.605061Z","shell.execute_reply.started":"2021-09-25T06:11:40.57923Z","shell.execute_reply":"2021-09-25T06:11:40.60439Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.nflId.median()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.606149Z","iopub.execute_input":"2021-09-25T06:11:40.606383Z","iopub.status.idle":"2021-09-25T06:11:40.675131Z","shell.execute_reply.started":"2021-09-25T06:11:40.606357Z","shell.execute_reply":"2021-09-25T06:11:40.674281Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4 = df1.nflId.fillna(df1.nflId.mean())","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.676451Z","iopub.execute_input":"2021-09-25T06:11:40.676748Z","iopub.status.idle":"2021-09-25T06:11:40.740924Z","shell.execute_reply.started":"2021-09-25T06:11:40.67671Z","shell.execute_reply":"2021-09-25T06:11:40.74014Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df4.head()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.742205Z","iopub.execute_input":"2021-09-25T06:11:40.74256Z","iopub.status.idle":"2021-09-25T06:11:40.751326Z","shell.execute_reply.started":"2021-09-25T06:11:40.742522Z","shell.execute_reply":"2021-09-25T06:11:40.750346Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.head()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.75213Z","iopub.execute_input":"2021-09-25T06:11:40.752367Z","iopub.status.idle":"2021-09-25T06:11:40.78121Z","shell.execute_reply.started":"2021-09-25T06:11:40.752331Z","shell.execute_reply":"2021-09-25T06:11:40.780219Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:40.785685Z","iopub.execute_input":"2021-09-25T06:11:40.786039Z","iopub.status.idle":"2021-09-25T06:11:48.695145Z","shell.execute_reply.started":"2021-09-25T06:11:40.786006Z","shell.execute_reply":"2021-09-25T06:11:48.694407Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.fillna({'o':df2,'dir':df3,'nflId':df4},inplace=True)","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:48.696126Z","iopub.execute_input":"2021-09-25T06:11:48.69635Z","iopub.status.idle":"2021-09-25T06:11:48.778228Z","shell.execute_reply.started":"2021-09-25T06:11:48.696325Z","shell.execute_reply":"2021-09-25T06:11:48.777172Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:48.779432Z","iopub.execute_input":"2021-09-25T06:11:48.779754Z","iopub.status.idle":"2021-09-25T06:11:56.616222Z","shell.execute_reply.started":"2021-09-25T06:11:48.779721Z","shell.execute_reply":"2021-09-25T06:11:56.615219Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.jerseyNumber.mean()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:56.617242Z","iopub.execute_input":"2021-09-25T06:11:56.618962Z","iopub.status.idle":"2021-09-25T06:11:56.644814Z","shell.execute_reply.started":"2021-09-25T06:11:56.618924Z","shell.execute_reply":"2021-09-25T06:11:56.643795Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.jerseyNumber.median()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:56.64614Z","iopub.execute_input":"2021-09-25T06:11:56.646487Z","iopub.status.idle":"2021-09-25T06:11:56.738574Z","shell.execute_reply.started":"2021-09-25T06:11:56.646446Z","shell.execute_reply":"2021-09-25T06:11:56.737445Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.jerseyNumber.mode()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:56.739891Z","iopub.execute_input":"2021-09-25T06:11:56.740181Z","iopub.status.idle":"2021-09-25T06:11:56.870191Z","shell.execute_reply.started":"2021-09-25T06:11:56.740151Z","shell.execute_reply":"2021-09-25T06:11:56.86938Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.position.unique()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:56.871393Z","iopub.execute_input":"2021-09-25T06:11:56.871618Z","iopub.status.idle":"2021-09-25T06:11:58.161478Z","shell.execute_reply.started":"2021-09-25T06:11:56.871593Z","shell.execute_reply":"2021-09-25T06:11:58.160636Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.jerseyNumber.unique()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:58.163329Z","iopub.execute_input":"2021-09-25T06:11:58.163668Z","iopub.status.idle":"2021-09-25T06:11:58.29468Z","shell.execute_reply.started":"2021-09-25T06:11:58.163626Z","shell.execute_reply":"2021-09-25T06:11:58.293782Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.describe()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:11:58.295824Z","iopub.execute_input":"2021-09-25T06:11:58.296043Z","iopub.status.idle":"2021-09-25T06:12:02.559826Z","shell.execute_reply.started":"2021-09-25T06:11:58.296018Z","shell.execute_reply":"2021-09-25T06:12:02.558744Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.jerseyNumber.describe()","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:12:02.561297Z","iopub.execute_input":"2021-09-25T06:12:02.561582Z","iopub.status.idle":"2021-09-25T06:12:02.871476Z","shell.execute_reply.started":"2021-09-25T06:12:02.561553Z","shell.execute_reply":"2021-09-25T06:12:02.870554Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import seaborn as sns","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:12:02.87257Z","iopub.execute_input":"2021-09-25T06:12:02.87279Z","iopub.status.idle":"2021-09-25T06:12:02.877226Z","shell.execute_reply.started":"2021-09-25T06:12:02.872765Z","shell.execute_reply":"2021-09-25T06:12:02.876418Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.histplot(df1.jerseyNumber,kde=True)","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:12:02.878777Z","iopub.execute_input":"2021-09-25T06:12:02.87904Z","iopub.status.idle":"2021-09-25T06:13:08.224682Z","shell.execute_reply.started":"2021-09-25T06:12:02.879012Z","shell.execute_reply":"2021-09-25T06:13:08.22375Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.histplot(df1.o,kde=True)","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:13:08.226194Z","iopub.execute_input":"2021-09-25T06:13:08.226523Z","iopub.status.idle":"2021-09-25T06:14:15.784653Z","shell.execute_reply.started":"2021-09-25T06:13:08.226483Z","shell.execute_reply":"2021-09-25T06:14:15.783788Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.histplot(df1.x,kde = True)","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:14:15.785919Z","iopub.execute_input":"2021-09-25T06:14:15.786244Z","iopub.status.idle":"2021-09-25T06:15:19.484021Z","shell.execute_reply.started":"2021-09-25T06:14:15.786202Z","shell.execute_reply":"2021-09-25T06:15:19.48319Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import seaborn as sns","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:15:19.485574Z","iopub.execute_input":"2021-09-25T06:15:19.48606Z","iopub.status.idle":"2021-09-25T06:15:19.490723Z","shell.execute_reply.started":"2021-09-25T06:15:19.486019Z","shell.execute_reply":"2021-09-25T06:15:19.489762Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.histplot(df1.y,kde=True)","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:15:19.492195Z","iopub.execute_input":"2021-09-25T06:15:19.492483Z","iopub.status.idle":"2021-09-25T06:16:22.815467Z","shell.execute_reply.started":"2021-09-25T06:15:19.492454Z","shell.execute_reply":"2021-09-25T06:16:22.814726Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.histplot(df1.s,kde=True)","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:20:46.117284Z","iopub.execute_input":"2021-09-25T06:20:46.117593Z","iopub.status.idle":"2021-09-25T06:21:44.854369Z","shell.execute_reply.started":"2021-09-25T06:20:46.117562Z","shell.execute_reply":"2021-09-25T06:21:44.852349Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.histplot(df1.a,kde=True)","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:17:43.214388Z","iopub.execute_input":"2021-09-25T06:17:43.215122Z","iopub.status.idle":"2021-09-25T06:18:48.922384Z","shell.execute_reply.started":"2021-09-25T06:17:43.215082Z","shell.execute_reply":"2021-09-25T06:18:48.921707Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.columns","metadata":{"execution":{"iopub.status.busy":"2021-09-25T06:29:26.892382Z","iopub.execute_input":"2021-09-25T06:29:26.892755Z","iopub.status.idle":"2021-09-25T06:29:26.900737Z","shell.execute_reply.started":"2021-09-25T06:29:26.892723Z","shell.execute_reply":"2021-09-25T06:29:26.900053Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}