{"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 numpy as np\nimport pandas as pd\nimport os\nimport plotly.express as px\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-10-31T15:49:55.130080Z","iopub.execute_input":"2021-10-31T15:49:55.131751Z","iopub.status.idle":"2021-10-31T15:49:55.137439Z","shell.execute_reply.started":"2021-10-31T15:49:55.131679Z","shell.execute_reply":"2021-10-31T15:49:55.136274Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pff=pd.read_csv('../input/nfl-big-data-bowl-2022/PFFScoutingData.csv')\npff[0:3]","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:49:55.139335Z","iopub.execute_input":"2021-10-31T15:49:55.140023Z","iopub.status.idle":"2021-10-31T15:49:55.248504Z","shell.execute_reply.started":"2021-10-31T15:49:55.139958Z","shell.execute_reply":"2021-10-31T15:49:55.247511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"games=pd.read_csv('../input/nfl-big-data-bowl-2022/games.csv')\ngames[0:3]","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:49:55.250117Z","iopub.execute_input":"2021-10-31T15:49:55.250360Z","iopub.status.idle":"2021-10-31T15:49:55.267658Z","shell.execute_reply.started":"2021-10-31T15:49:55.250330Z","shell.execute_reply":"2021-10-31T15:49:55.266172Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"players=pd.read_csv('../input/nfl-big-data-bowl-2022/players.csv')\nplayers[0:3]","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:49:55.270015Z","iopub.execute_input":"2021-10-31T15:49:55.270301Z","iopub.status.idle":"2021-10-31T15:49:55.295223Z","shell.execute_reply.started":"2021-10-31T15:49:55.270269Z","shell.execute_reply":"2021-10-31T15:49:55.294099Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays=pd.read_csv('../input/nfl-big-data-bowl-2022/plays.csv')\nplays[0:3]","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:49:55.296747Z","iopub.execute_input":"2021-10-31T15:49:55.297183Z","iopub.status.idle":"2021-10-31T15:49:55.524318Z","shell.execute_reply.started":"2021-10-31T15:49:55.297147Z","shell.execute_reply":"2021-10-31T15:49:55.523729Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tracking2020=pd.read_csv('../input/nfl-big-data-bowl-2022/tracking2020.csv')\ntracking2020[0:3]","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:49:55.525450Z","iopub.execute_input":"2021-10-31T15:49:55.525818Z","iopub.status.idle":"2021-10-31T15:50:29.308007Z","shell.execute_reply.started":"2021-10-31T15:49:55.525788Z","shell.execute_reply":"2021-10-31T15:50:29.306807Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"track1=tracking2020[tracking2020['playId']==40]\ntrack1[0:3]","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:50:29.309755Z","iopub.execute_input":"2021-10-31T15:50:29.310001Z","iopub.status.idle":"2021-10-31T15:50:29.394827Z","shell.execute_reply.started":"2021-10-31T15:50:29.309973Z","shell.execute_reply":"2021-10-31T15:50:29.393837Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig=make_subplots(specs=[[{\"secondary_y\":False}]])\nfig.add_trace(go.Scatter(x=track1['x'],y=track1['y'],name='track1'),secondary_y=False,)\nfig.update_layout(autosize=False,width=700,height=500,title_text=\"track1\")\nfig.update_xaxes(title_text=\"x\")\nfig.update_yaxes(title_text=\"y\")\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:50:29.396482Z","iopub.execute_input":"2021-10-31T15:50:29.396779Z","iopub.status.idle":"2021-10-31T15:50:29.484325Z","shell.execute_reply.started":"2021-10-31T15:50:29.396748Z","shell.execute_reply":"2021-10-31T15:50:29.483451Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Name0=track1['jerseyNumber'].unique().astype(int).tolist()\nName=sorted(Name0)\nprint(Name)","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:50:29.486468Z","iopub.execute_input":"2021-10-31T15:50:29.486765Z","iopub.status.idle":"2021-10-31T15:50:29.494697Z","shell.execute_reply.started":"2021-10-31T15:50:29.486729Z","shell.execute_reply":"2021-10-31T15:50:29.493731Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig=make_subplots(specs=[[{\"secondary_y\":False}]])\nfor i in range(1,11):\n    fig.add_trace(go.Scatter(x=track1[track1['jerseyNumber']==i]['x'],y=track1[track1['jerseyNumber']==i]['y'],name='jerseyNumber: '+str(i)),secondary_y=False,)\nfig.update_layout(autosize=False,width=700,height=500,title_text=\"track1\")\nfig.update_xaxes(title_text=\"x\")\nfig.update_yaxes(title_text=\"y\")\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:50:29.495926Z","iopub.execute_input":"2021-10-31T15:50:29.496626Z","iopub.status.idle":"2021-10-31T15:50:29.559967Z","shell.execute_reply.started":"2021-10-31T15:50:29.496592Z","shell.execute_reply":"2021-10-31T15:50:29.559108Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Time0=track1['time'].unique().tolist()\nTime=sorted(Time0)\nprint(Time[0:10])","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:50:29.561551Z","iopub.execute_input":"2021-10-31T15:50:29.562030Z","iopub.status.idle":"2021-10-31T15:50:29.593923Z","shell.execute_reply.started":"2021-10-31T15:50:29.561989Z","shell.execute_reply":"2021-10-31T15:50:29.592964Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig=make_subplots(specs=[[{\"secondary_y\":False}]])\nfor i in range(1,30,2):\n    fig.add_trace(go.Scatter(x=track1[track1['time']==Time[i]]['x'],y=track1[track1['time']==Time[i]]['y'],mode='markers',name='time: '+str(Time[i])),secondary_y=False,)\n    fig.update_layout(autosize=False,width=700,height=500,title_text=\"track1\")\n    fig.update_xaxes(title_text=\"x\")\n    fig.update_yaxes(title_text=\"y\")\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2021-10-31T15:50:29.595411Z","iopub.execute_input":"2021-10-31T15:50:29.595743Z","iopub.status.idle":"2021-10-31T15:50:30.667546Z","shell.execute_reply.started":"2021-10-31T15:50:29.595698Z","shell.execute_reply":"2021-10-31T15:50:30.666593Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}