{"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":"markdown","source":"<center><h1>Big Data Bowl 2022</h1></center>\n<center><h2>Evaluating Headhunters: KIPPER</h2></center>\n<center><h3>Kickoff and Punt Player Efficiency Rating</h3></center>","metadata":{}},{"cell_type":"markdown","source":"Special teams units are filled with the unsung heroes of the game. The irony is that greatness on special teams is excellent job security because great teams have great special teams units. Football is a game of inches and champions value every inch of better field position. I am creating a metric to capture the true value of performance of these headhunters on the field.","metadata":{}},{"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\npd.options.mode.chained_assignment = None\n\n\nimport os\n\nplayers_df = pd.read_csv('../input/nfl-big-data-bowl-2022/players.csv')\npff_data_df = pd.read_csv('../input/nfl-big-data-bowl-2022/PFFScoutingData.csv')\ntracking2020_df = pd.read_csv('../input/nfl-big-data-bowl-2022/tracking2020.csv')\ngames_df = pd.read_csv('../input/nfl-big-data-bowl-2022/games.csv')\nplays_df = pd.read_csv('../input/nfl-big-data-bowl-2022/plays.csv')\n\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":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-01-06T22:58:09.426279Z","iopub.execute_input":"2022-01-06T22:58:09.427313Z","iopub.status.idle":"2022-01-06T22:58:38.397992Z","shell.execute_reply.started":"2022-01-06T22:58:09.42726Z","shell.execute_reply":"2022-01-06T22:58:38.396977Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center>Combine Plays Dataframe and Tracking 2020 on playID</center>","metadata":{}},{"cell_type":"code","source":"plays_tracking2020_df = pd.merge(plays_df, tracking2020_df, left_on=['playId', plays_df['specialTeamsPlayType'].str.lower()], right_on=['playId', 'event'])","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:58:38.400338Z","iopub.execute_input":"2022-01-06T22:58:38.400691Z","iopub.status.idle":"2022-01-06T22:58:44.808531Z","shell.execute_reply.started":"2022-01-06T22:58:38.400627Z","shell.execute_reply":"2022-01-06T22:58:44.807485Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays_tracking2020_df = plays_tracking2020_df.rename(columns={\"gameId_y\": \"gameId\"})","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:58:44.809968Z","iopub.execute_input":"2022-01-06T22:58:44.810185Z","iopub.status.idle":"2022-01-06T22:58:45.111593Z","shell.execute_reply.started":"2022-01-06T22:58:44.810158Z","shell.execute_reply":"2022-01-06T22:58:45.110459Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <center>Max Acceleration By Player 2020</center>","metadata":{}},{"cell_type":"code","source":"max_a_df = plays_tracking2020_df.loc[plays_tracking2020_df.groupby(\"nflId\")['a'].idxmax()]\nplayer_2020_master_df = max_a_df[['nflId', 'a', 'displayName', 'position']].copy()\nplayer_2020_master_df = player_2020_master_df.rename(columns={\"a\": \"max_acceleration\"})\nplayer_2020_master_df = player_2020_master_df.reset_index(drop=True)\nplayer_2020_master_df.head(10)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:58:45.11327Z","iopub.execute_input":"2022-01-06T22:58:45.113518Z","iopub.status.idle":"2022-01-06T22:58:45.294669Z","shell.execute_reply.started":"2022-01-06T22:58:45.113488Z","shell.execute_reply":"2022-01-06T22:58:45.293484Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center>Organize players by snaps played on Kickoff and Punt in 2020</center>","metadata":{}},{"cell_type":"code","source":"unique_plays_tracking2020_df = plays_tracking2020_df.drop_duplicates(subset=['playId'])\nunique_kickoffs_tracking2020_df = unique_plays_tracking2020_df[unique_plays_tracking2020_df['specialTeamsPlayType'] == 'Kickoff']\nunique_kickoffs_tracking2020_df['nflId'].value_counts()\n\nplayer_2020_kickoff_aggregate = {}\n\nfor nfl_Id in player_2020_master_df.nflId:\n    kickoff_snaps = unique_kickoffs_tracking2020_df.loc[(unique_kickoffs_tracking2020_df['nflId'] == nfl_Id)].shape[0]\n    \n    if kickoff_snaps > 0:\n        player_2020_kickoff_aggregate[nfl_Id] = kickoff_snaps\n    else:\n        player_2020_kickoff_aggregate[nfl_Id] = 0\n\nplayer_2020_kickoff_snaps_series = pd.Series(player_2020_kickoff_aggregate)\nplayer_2020_master_df['kickoff_snaps'] = player_2020_kickoff_snaps_series.values\n\n\nunique_plays_tracking2020_df = plays_tracking2020_df.drop_duplicates(subset=['playId'])\nunique_punts_tracking2020_df = unique_plays_tracking2020_df[unique_plays_tracking2020_df['specialTeamsPlayType'] == 'Punt']\nunique_punts_tracking2020_df.head(20)\nunique_punts_tracking2020_df['nflId'].value_counts()\n\nplayer_2020_punt_aggregate = {}\n\nfor nfl_Id in player_2020_master_df.nflId:\n    punt_snaps = unique_punts_tracking2020_df.loc[(unique_punts_tracking2020_df['nflId'] == nfl_Id)].shape[0]\n    \n    if punt_snaps > 0:\n        player_2020_punt_aggregate[nfl_Id] = punt_snaps\n    else:\n        player_2020_punt_aggregate[nfl_Id] = 0\n        \nplayer_2020_punt_snaps_series = pd.Series(player_2020_punt_aggregate)\nplayer_2020_master_df['punt_snaps'] = player_2020_punt_snaps_series.values\nplayer_2020_master_df['punt_or_kickoff'] = player_2020_master_df['kickoff_snaps'] + player_2020_master_df['punt_snaps']","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-01-06T22:58:45.296996Z","iopub.execute_input":"2022-01-06T22:58:45.29724Z","iopub.status.idle":"2022-01-06T22:58:46.388666Z","shell.execute_reply.started":"2022-01-06T22:58:45.297199Z","shell.execute_reply":"2022-01-06T22:58:46.387697Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center>Get the team and jersey for each player (Including Team Switches)</center>","metadata":{}},{"cell_type":"code","source":"unique_plays_tracking2020_df = plays_tracking2020_df.drop_duplicates(subset=['playId'])\ngames_plays_tracking2020_df = pd.merge(plays_tracking2020_df, games_df[['gameId','homeTeamAbbr','visitorTeamAbbr']], on=['gameId'])\ngames_plays_tracking2020_df = games_plays_tracking2020_df.sort_values(by=['nflId'], ascending=True)\n\nplayer_2020_team_aggregate = {}\nfor i in games_plays_tracking2020_df.index:\n    \n    nflId = games_plays_tracking2020_df['nflId'][i]\n    displayName = games_plays_tracking2020_df['displayName'][i]\n    team = games_plays_tracking2020_df['team'][i]\n    homeTeamAbbr = games_plays_tracking2020_df['homeTeamAbbr'][i]\n    visitorTeamAbbr = games_plays_tracking2020_df['visitorTeamAbbr'][i]\n    jerseyNumber = games_plays_tracking2020_df['jerseyNumber'][i]\n    \n    if team == 'home':\n        \n        jerseyNumber = str(int(jerseyNumber))\n        try:\n            player_2020_team_aggregate[f'{nflId}'].add(f'{homeTeamAbbr} {jerseyNumber}')\n        except KeyError:\n            player_2020_team_aggregate[f'{nflId}'] = {f'{homeTeamAbbr} {jerseyNumber}'}\n    elif team == 'away':\n        \n        jerseyNumber = str(int(jerseyNumber))\n        try:\n            player_2020_team_aggregate[f'{nflId}'].add(f'{visitorTeamAbbr} {jerseyNumber}')\n        except KeyError:\n            player_2020_team_aggregate[f'{nflId}'] = {f'{visitorTeamAbbr} {jerseyNumber}'}\n\nplayer_2020_team_series = pd.Series(player_2020_team_aggregate)\nplayer_2020_master_df['team_jerseyNumber'] = player_2020_team_series.values\nplayer_2020_master_df.head(20)","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-01-06T22:58:46.390603Z","iopub.execute_input":"2022-01-06T22:58:46.390966Z","iopub.status.idle":"2022-01-06T22:59:28.030332Z","shell.execute_reply.started":"2022-01-06T22:58:46.39092Z","shell.execute_reply":"2022-01-06T22:59:28.029433Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<center>Get PFF Dataframe for the 2020 season</center>","metadata":{}},{"cell_type":"code","source":"games_pff_df = pd.merge(pff_data_df, games_df, left_on=['gameId'], right_on=['gameId'])\npff_2020_df = games_pff_df[(games_pff_df['season'] == 2020)]","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:28.03187Z","iopub.execute_input":"2022-01-06T22:59:28.032287Z","iopub.status.idle":"2022-01-06T22:59:28.060558Z","shell.execute_reply.started":"2022-01-06T22:59:28.032246Z","shell.execute_reply":"2022-01-06T22:59:28.059698Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center><h1>Organize Players By Tackles Made and Missed</h1></center>\n","metadata":{}},{"cell_type":"code","source":"solo_tackle_aggregate = {}\n\nfor nflId in player_2020_master_df['nflId']:\n    \n    team_jerseyNumbers = player_2020_master_df.loc[(player_2020_master_df['nflId'] == nflId)].team_jerseyNumber.iloc[0]\n    \n    total_solo_tackles = 0\n    for team_jerseyNumber in team_jerseyNumbers:\n        \n        team_jerseyNumber = team_jerseyNumber.strip()\n        total_solo_tackles += pff_2020_df.loc[(pff_2020_df['tackler'] == team_jerseyNumber)].shape[0] \n    \n    nflId = str(int(nflId))\n    solo_tackle_aggregate[f'{nflId}'] = total_solo_tackles\n\nsolo_tackle_aggregate_series = pd.Series(solo_tackle_aggregate)\nplayer_2020_master_df['solo_tackles'] = solo_tackle_aggregate_series.values","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-01-06T22:59:28.062068Z","iopub.execute_input":"2022-01-06T22:59:28.062317Z","iopub.status.idle":"2022-01-06T22:59:29.949473Z","shell.execute_reply.started":"2022-01-06T22:59:28.062285Z","shell.execute_reply":"2022-01-06T22:59:29.948783Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<center>Organize Players By Assisted Tackles Made</center>","metadata":{}},{"cell_type":"code","source":"player_2020_assist_tackle_aggregate = {}\n\nfor nflId in player_2020_master_df['nflId']:\n    \n    team_jerseyNumbers = player_2020_master_df.loc[(player_2020_master_df['nflId'] == nflId)].team_jerseyNumber.iloc[0]\n    \n    total_assist_tackles = 0\n    for team_jerseyNumber in team_jerseyNumbers:\n        \n        team_jerseyNumber = team_jerseyNumber.strip()\n        total_assist_tackles += pff_2020_df.loc[(pff_2020_df['assistTackler'] == team_jerseyNumber)].shape[0] \n    \n    nflId = str(int(nflId))\n    player_2020_assist_tackle_aggregate[f'{nflId}'] = total_assist_tackles\n    \nplayer_2020_assist_tackle_series = pd.Series(player_2020_assist_tackle_aggregate)\nplayer_2020_master_df['assist_tackles'] = player_2020_assist_tackle_series.values","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-01-06T22:59:29.950651Z","iopub.execute_input":"2022-01-06T22:59:29.950904Z","iopub.status.idle":"2022-01-06T22:59:31.582295Z","shell.execute_reply.started":"2022-01-06T22:59:29.950872Z","shell.execute_reply":"2022-01-06T22:59:31.581242Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center>Get Total Tackles</center>","metadata":{}},{"cell_type":"code","source":"player_2020_master_df['total_tackles'] = player_2020_master_df['solo_tackles'] + (player_2020_master_df['assist_tackles'] / 2)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:31.583481Z","iopub.execute_input":"2022-01-06T22:59:31.583711Z","iopub.status.idle":"2022-01-06T22:59:31.589896Z","shell.execute_reply.started":"2022-01-06T22:59:31.583683Z","shell.execute_reply":"2022-01-06T22:59:31.588935Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center>Organize Players by Missed Tackles</center>","metadata":{}},{"cell_type":"code","source":"player_2020_missed_tackle_aggregate = {}\n\nfor nflId in player_2020_master_df['nflId']:\n    \n    team_jerseyNumbers = player_2020_master_df.loc[(player_2020_master_df['nflId'] == nflId)].team_jerseyNumber.iloc[0]\n    total_missed_tackles = 0\n    for team_jerseyNumber in team_jerseyNumbers:\n\n        team_jerseyNumber = team_jerseyNumber.strip()\n        total_missed_tackles += pff_2020_df['missedTackler'].str.contains(team_jerseyNumber).sum() \n    \n    nflId = str(int(nflId))\n    player_2020_missed_tackle_aggregate[f'{nflId}'] = total_missed_tackles\n    \nplayer_2020_missed_tackle_series = pd.Series(player_2020_missed_tackle_aggregate)\nplayer_2020_master_df['missed_tackles'] = player_2020_missed_tackle_series.values","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-01-06T22:59:31.591124Z","iopub.execute_input":"2022-01-06T22:59:31.59138Z","iopub.status.idle":"2022-01-06T22:59:36.399482Z","shell.execute_reply.started":"2022-01-06T22:59:31.591348Z","shell.execute_reply":"2022-01-06T22:59:36.398848Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center>Get Net Tackles</center>","metadata":{}},{"cell_type":"code","source":"player_2020_master_df['net_tackles'] = player_2020_master_df['total_tackles'] - player_2020_master_df['missed_tackles']","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:36.400774Z","iopub.execute_input":"2022-01-06T22:59:36.401278Z","iopub.status.idle":"2022-01-06T22:59:36.413277Z","shell.execute_reply.started":"2022-01-06T22:59:36.40124Z","shell.execute_reply":"2022-01-06T22:59:36.412431Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center>Get Tackling Efficiency for each player</center>","metadata":{}},{"cell_type":"code","source":"player_2020_master_df['tackle_efficiency'] = player_2020_master_df['net_tackles'] / player_2020_master_df['punt_or_kickoff']","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:36.41441Z","iopub.execute_input":"2022-01-06T22:59:36.414715Z","iopub.status.idle":"2022-01-06T22:59:36.429879Z","shell.execute_reply.started":"2022-01-06T22:59:36.414686Z","shell.execute_reply":"2022-01-06T22:59:36.429024Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center>Players with more than 30 Kickoff or Punt snaps in 2020</center>","metadata":{}},{"cell_type":"code","source":"filtered_master_dataframe = player_2020_master_df.loc[(player_2020_master_df['punt_or_kickoff'] > 30)]","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-01-06T22:59:36.435345Z","iopub.execute_input":"2022-01-06T22:59:36.435612Z","iopub.status.idle":"2022-01-06T22:59:36.444478Z","shell.execute_reply.started":"2022-01-06T22:59:36.435582Z","shell.execute_reply":"2022-01-06T22:59:36.443855Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <center>Correlation Between Acceleration and Net Tackles</center>\n\nMax acceleration has a 77.57% positive correlation with net tackles, while max speed had a week positive correlation. This makes perfect sense because anyone who played knows that straightforward speed is not enough, you have to be able to change direction quickly and meet the target at an angle. Or as an old coach said \"You meet them where they are going to be, not where they are\". Usama Young also referenced this in the starter video when he said:\n“Speed and angles, you can’t teach speed but oftentimes angles beat speed”. \n\nAnd when it comes to fighting off blocks: **ACCELERATION CREATES SEPERATION!**","metadata":{}},{"cell_type":"code","source":"max_acceleration = filtered_master_dataframe[\"max_acceleration\"]\ntotal_tackles = filtered_master_dataframe[\"net_tackles\"]\nmax_acceleration_tackles_correlation = max_acceleration.corr(total_tackles)\nprint(max_acceleration_tackles_correlation)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:36.445515Z","iopub.execute_input":"2022-01-06T22:59:36.446266Z","iopub.status.idle":"2022-01-06T22:59:36.459731Z","shell.execute_reply.started":"2022-01-06T22:59:36.446218Z","shell.execute_reply":"2022-01-06T22:59:36.45904Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"max_acceleration_tackles_line = filtered_master_dataframe.plot.line(x='max_acceleration', y='total_tackles')","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:36.46092Z","iopub.execute_input":"2022-01-06T22:59:36.461719Z","iopub.status.idle":"2022-01-06T22:59:37.140452Z","shell.execute_reply.started":"2022-01-06T22:59:36.461678Z","shell.execute_reply":"2022-01-06T22:59:37.139401Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <center>Create ranking of players by kickoff and punt snaps</center>\n\nThe KIPPER rating (Please don't sue me John Hollinger) factors in the player's net tackling efficiency and their acceleration. Acceleration impacts more than just tackling, the change in direction is also needed to properly fill a lane on kickoff and punt. ","metadata":{}},{"cell_type":"code","source":"filtered_master_dataframe['efficiency_rank'] = filtered_master_dataframe['tackle_efficiency'].rank(ascending=False)\nfiltered_master_dataframe['max_acceleration_rank'] = filtered_master_dataframe['max_acceleration'].rank(ascending=False)","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-01-06T22:59:37.141958Z","iopub.execute_input":"2022-01-06T22:59:37.142257Z","iopub.status.idle":"2022-01-06T22:59:37.150125Z","shell.execute_reply.started":"2022-01-06T22:59:37.14222Z","shell.execute_reply":"2022-01-06T22:59:37.148895Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"filtered_master_dataframe['kipper'] = filtered_master_dataframe['efficiency_rank'] + filtered_master_dataframe['max_acceleration_rank']","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:37.151989Z","iopub.execute_input":"2022-01-06T22:59:37.152665Z","iopub.status.idle":"2022-01-06T22:59:37.164163Z","shell.execute_reply.started":"2022-01-06T22:59:37.152603Z","shell.execute_reply":"2022-01-06T22:59:37.163403Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"filtered_master_dataframe = filtered_master_dataframe.sort_values('kipper')\nrank_columns = ['nflId','displayName', 'kipper', 'efficiency_rank', 'max_acceleration_rank', 'tackle_efficiency', 'team_jerseyNumber']\nrank_master_dataframe_30_snaps = pd.DataFrame(filtered_master_dataframe, columns=rank_columns)\nrank_master_dataframe_30_snaps.head(10)","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-01-06T22:59:37.16528Z","iopub.execute_input":"2022-01-06T22:59:37.166218Z","iopub.status.idle":"2022-01-06T22:59:37.195985Z","shell.execute_reply.started":"2022-01-06T22:59:37.166184Z","shell.execute_reply":"2022-01-06T22:59:37.195101Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" <center><h1>Create a rank of players with 20 or more snaps</h1></center>","metadata":{}},{"cell_type":"code","source":"filtered_master_dataframe_20 = player_2020_master_df.loc[(player_2020_master_df['punt_or_kickoff'] > 20)]\nmax_acceleration_20 = filtered_master_dataframe_20[\"max_acceleration\"]\nnet_tackles_20 = filtered_master_dataframe_20[\"net_tackles\"]\n\nfiltered_master_dataframe_20['efficiency_rank'] = filtered_master_dataframe_20['tackle_efficiency'].rank(ascending=False)\nfiltered_master_dataframe_20['max_acceleration_rank'] = filtered_master_dataframe_20['max_acceleration'].rank(ascending=False)\n\nfiltered_master_dataframe_20['kipper'] = filtered_master_dataframe_20['efficiency_rank'] + filtered_master_dataframe_20['max_acceleration_rank']\n\nfiltered_master_dataframe_20 = filtered_master_dataframe_20.sort_values('kipper')\nrank_master_dataframe_20_snaps = pd.DataFrame(filtered_master_dataframe_20, columns=rank_columns)\nrank_master_dataframe_20_snaps.head(10)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:37.197112Z","iopub.execute_input":"2022-01-06T22:59:37.197727Z","iopub.status.idle":"2022-01-06T22:59:37.227161Z","shell.execute_reply.started":"2022-01-06T22:59:37.197695Z","shell.execute_reply":"2022-01-06T22:59:37.226292Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<center><h1>Create a rank of players with 10 or more snaps</h1></center>","metadata":{}},{"cell_type":"code","source":"filtered_master_dataframe_10 = player_2020_master_df.loc[(player_2020_master_df['punt_or_kickoff'] > 10)]\nmax_acceleration_10 = filtered_master_dataframe_10[\"max_acceleration\"]\nnet_tackles_10 = filtered_master_dataframe_10[\"net_tackles\"]\n\nfiltered_master_dataframe_10['efficiency_rank'] = filtered_master_dataframe_10['tackle_efficiency'].rank(ascending=False)\nfiltered_master_dataframe_10['max_acceleration_rank'] = filtered_master_dataframe_10['max_acceleration'].rank(ascending=False)\n\nfiltered_master_dataframe_10['kipper'] = filtered_master_dataframe_10['efficiency_rank'] + filtered_master_dataframe_10['max_acceleration_rank']\n\nfiltered_master_dataframe_10 = filtered_master_dataframe_10.sort_values('kipper')\nrank_master_dataframe_10_snaps = pd.DataFrame(filtered_master_dataframe_10, columns=rank_columns)\n","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2022-01-06T22:59:37.228451Z","iopub.execute_input":"2022-01-06T22:59:37.228932Z","iopub.status.idle":"2022-01-06T22:59:37.240952Z","shell.execute_reply.started":"2022-01-06T22:59:37.228897Z","shell.execute_reply":"2022-01-06T22:59:37.240026Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"rank_master_dataframe_10_snaps.head(10)","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:37.242125Z","iopub.execute_input":"2022-01-06T22:59:37.242417Z","iopub.status.idle":"2022-01-06T22:59:37.26649Z","shell.execute_reply.started":"2022-01-06T22:59:37.242389Z","shell.execute_reply":"2022-01-06T22:59:37.265764Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"player_2020_master_df.to_csv('player_2020_master_df.csv')\nfiltered_master_dataframe.to_csv('filtered_master_dataframe.csv')","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:59:37.26758Z","iopub.execute_input":"2022-01-06T22:59:37.268071Z","iopub.status.idle":"2022-01-06T22:59:37.304717Z","shell.execute_reply.started":"2022-01-06T22:59:37.268038Z","shell.execute_reply":"2022-01-06T22:59:37.303862Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <center>Conclusion</center>\n\nA clearly defined metric makes special teams personnel management much more straightforward. A KIPPER rank can be calculated every 10 kickof + punt snaps, roughly equating to each game. This gives so much opportunity to players in the preseason and in training camp. This does not even factor the many ways I am improving KIPPER after the current round of the competition, like accomodating kickers and punters.\n\nFor players over 30 snaps, the fact that the top 3 (**Jordan Dangerfield**, **Sherrick McManis**, and **Craig Robertson**) were all special teams captains last season whie the 4th (**Anthony Levine**) was a co-captain shows that KIPPER is looking at the right features and can only get more refined. Jordan Dangerfield having the best KIPPER on 10+ snaps, 20+ snaps, and 30+ snaps also shows how elite and consistent he was.\n","metadata":{}},{"cell_type":"markdown","source":"# <center>Bonus Content</center>\n<center>Found a video giving credit to our MVP last season!</center>","metadata":{"execution":{"iopub.status.busy":"2022-01-06T22:05:36.145604Z","iopub.execute_input":"2022-01-06T22:05:36.146224Z","iopub.status.idle":"2022-01-06T22:05:36.150382Z","shell.execute_reply.started":"2022-01-06T22:05:36.146168Z","shell.execute_reply":"2022-01-06T22:05:36.149809Z"}}},{"cell_type":"markdown","source":"<iframe width=\"1250\" height=\"703\" src=\"https://www.youtube.com/embed/lVipB3i3H1g\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>","metadata":{}}]}