{"cells":[{"metadata":{},"cell_type":"markdown","source":"# Introduction\nHealth issues in Americal football are common because of its nature of the full-contact game. But authority like the NFL is trying to reduce the health issues from its core. They are trying their best for finding solutions. The previous year, NFL created a competition for reducing concussion in punt and this year they created a competition for finding the relationship between playing surface, injury and player movement. \n\nThis notebook is the main submission for this year NFL analytics competition. In this notebook, I have tried my best for finding the relationship between playing environmental factors, player movement and injury. I hope this will help the NFL to reduce the risk of injury in football."},{"metadata":{},"cell_type":"markdown","source":"# Main findings and results \n* **Result 1**: Previously we know, Synthetic turf has significantly higher injury rates on synthetic turf compared with natural turf (Mack et al., 2018; Loughran et al., 2019). Now we found that Toes and Ankle injuries are higher in synthetic turf compared to natural turf. Heel and foot injuries are higher in natural turf compared to synthetic turf. \n\n* **Result 2**: Temperature in injury play is higher compared to non-injury play. That means higher temperature contributes to injuries. Also, we found that most of the injuries happened in the outdoor stadium. \n\n* **Result 3**: 72% of injuries happened during the first 10 games of individual players. This is one of the important findings. Because this will help players, team, coach and supervisor to take previous necessary steps to reduce injury. We also found that the field that player got injured, in 55% injuries the field type is different from the immediate previous game. And goes up to 63% in synthetic turf. \n\n* **Result 3**: We have created several movement metrics for identifying injury risk in player movement. All of these metrics results are \n    1. **Numer of Declaration, acceleration, no acceleration/deceleration in last 20 seconds**: We have noted that all these metrics slightly higher in the injured players but we don't find any significant differences in different surface condition. But we found that the number of declaration and acceleration are higher in synthetic turf. \n    2. **Mean acceleration, speed, distance, direction, orientation, directional changes and orientation changes**: We found injured players have higher mean direction, orientation, directional changes and orientational changes compared to the non-injured players. But we don't find significant differences in a different field. \n    3. **Max acceleration, speed, distance, direction, orientation, directional changes and orientation changes**: Among all these metrics, we found one metrics are useful. That is max-acceleration. We found that max acceleration is higher in injured player compared to the non-injured players and we found that max acceleration is very high in synthetic turf compared to natural turf. "},{"metadata":{},"cell_type":"markdown","source":"# Proposal for reducing injuries based on our findings\nNow we saw surface, environment and movement contributions in injuries. But how do we solve this problem and reduce injuries?\n\nWe have to follow what FIFA has done. FIFA created a very important program called 'FIFA Quality Program' where they use some criteria to identify different materials for the game. One of them is FIFA quality turf. NFL is one of the top organization for American football. Because American football is vastly different from soccer, we have to make our own 'NFL Quality Standard Program'. Where the NFL can use criteria for identifying turf that does not contribute to injury rather, it helps reduce the risk of injuries.\n\n* **Proposal 1**: Improve field response mechanism for artificial Turf. \"Artificial turf is a harder surface than grass and does not have much \"give\" when forces are placed on it\" [1]. We have to solve this problem. We have to make our artificial turf that mimics the natural grass. Because when players toys are bend or stressed during play and the turf doesn't help in that situation then player got injured in toy or ankle. \n\n* **Proposal 2**: Make artificial turf relief heat of the sun or in general. Because we saw a high temperature contributes to injuries. And artificial turf tends to retain heat compared to natural turf. \n\n* **Proposal 3**: American football is very tense and high contact game. Often player needs to move fast in any direction, jump and stop or tackle the player with high speed. For that high acceleration, speed and velocity are essential. But we saw in our analysis that in most injury play the acceleration and other movement metrics is high. But synthetic turf surfaces do not release cleats as readily as natural turf. For not releasing cleats like natural turf, players got injured. We have two ways to solve that problem.\n\n    1. Improve field rubber and traction mechanism: We have to improve our field rubber and silicon and other variables for making easy releasing cleats and also we have to make sure it doesn't produce more friction or force that cause problems in player movement. \n    \n    2. Use shoes that are exclusively built for synthetic turf: While many cleats manufactured today for football can be used on artificial turf or natural surfaces, many moulded cleats are designed and better served for use on artificial turf. The moulded cleats tend to provide better traction on artificial surfaces, whereas detachable studs on cleats tend to be too thick for artificial turf and do not provide adequate grip on such a surface [2].\n    \n    \n    \n* **Proposal 4**: One of the best benefits about artificial turf is that it needs less maintenance and most of the time it surfaces are plain and in rain, it doesn't have any decay or any other effect. In natural turf, the surface easily got problem after each game and in rain, the surface got a massive problem. One of the problems is not a plain surface. We saw in our analysis that heel and foot have mostly occurred in natural turf. \n\n  And from research [1] we know that foot and heel injuries occurred mostly because of uneven surface. So we have to make sure that natural turf that in each game and in-between game we have to repair natural turf. These will mostly reduce heel and foot injuries. **But we have to use real-time field analysis camera that uses machine learning to assess field condition. This way the NFL can make sure that field condition is good in the game. **\n  \n\n* **Proposal 5**: One of the important things we found in our analysis is that most of the injuries happened in the player first 10 games. Secondly, we found that for injuries player has less experience with the injured surface, field and play type compared to the non-injured player. For that reason, we can say that player having less experience in playing surface, the environment is one of the main causes of injury. To solve this problem, we have two ways. \n\n    1. Assess player fitness and FM score: We have seen that 72% of the injuries happened during the first 10 games of each player. So to solve this problem we have to inform players, teams, coaches and teams about this information. And advice them to make sure to assess player fitness and functional movement score before games. \n    \n    Also, we found that most of the injured player's previous game field is different. So coaches should make sure that player got enough practice on the field that he is going to play. "},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport gc\n#################\n# Import our dataset and libraies\n#################\n\n# basic libraries\nimport pandas as pd\nimport numpy as np\nimport textwrap\n\n# plotly imports\nimport plotly.express as px\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots\nfrom plotly.offline import init_notebook_mode\ninit_notebook_mode(connected=True)\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"_kg_hide-output":false,"trusted":true},"cell_type":"code","source":"def split_id(dataframe):\n    dataframe['PlayKey'] = dataframe.PlayKey.fillna('0-0-0')\n    id_array = dataframe.PlayKey.str.split('-', expand=True).to_numpy()\n    dataframe['PlayerKey'] = id_array[:,0]\n    dataframe['GameID'] = id_array[:,1]\n    dataframe['PlayKey'] = id_array[:,2]\n    \n    return dataframe\n\n\ndef percentage(x):\n    \"\"\"function for counting percentage in pandas column\"\"\"\n    return round((x/x.sum())*100, 1)\n\n\ndef calculate_pre_experience(dataframe, column_name, new_col_name):\n    unique_value_list = dataframe[column_name].dropna().unique().tolist()\n    df_list = []\n    for value in unique_value_list:\n        temp = dataframe.loc[dataframe[column_name] == value]\n\n        temp.loc[(temp.status == 'injured'), 'rolling_break'] = 1\n        temp['rolling_break'] = temp['rolling_break'].shift(1)\n        temp['rolling_break'] = temp['rolling_break'].fillna(0)\n\n        temp['cumsum'] = temp['rolling_break'].cumsum()\n        temp[new_col_name]= temp.groupby(['PlayerKey','cumsum'])[column_name].cumcount()\n        \n        df_list.append(temp)\n    return pd.concat(df_list)\n\n\n\n\ndef calculate_velocity(x):\n    temp = x.copy()\n    displacement = temp[['x', 'y']].diff()\n    displacement['displacement'] = np.sqrt(displacement.x**2 + displacement.y**2)\n    displacement['displacement'] = displacement['displacement'].fillna(0)\n    temp['velocity'] = (displacement['displacement'] / .10).values\n\n    velocity = temp['velocity'].diff().fillna(0)\n    temp['acceleration'] = (velocity / .10).values\n    \n    del velocity, displacement\n    t = gc.collect()\n    \n    temp['velocity'] = temp['velocity'].astype('float32')\n    temp['acceleration'] = temp['acceleration'].astype('float32')\n    \n    return temp\n\n\n\ndef calc_num_event(dataframe,\n                   event_col_name,\n                   event_col_value,\n                   num_element,\n                   new_col_name):\n    temp = dataframe.groupby(['PlayerKey', 'GameID', 'PlayKey']).tail(num_element)\n    temp = temp.loc[temp[event_col_name] == event_col_value]\n    temp = temp.groupby(['PlayerKey', 'GameID', 'PlayKey'])[event_col_name].count().reset_index()\n    temp = temp.rename(columns={event_col_name: new_col_name})\n    return temp","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"\ndf_track_data = pd.read_parquet('../input/using-track-data-with-small-memory/InjuryRecord.parq', engine='pyarrow')\ndf_injury = pd.read_csv('../input/nfl-playing-surface-analytics/InjuryRecord.csv')\ndf_play_list = pd.read_csv('../input/nfl-playing-surface-analytics/PlayList.csv')\n\n\ndf_injury = split_id(df_injury)\ndf_play_list = split_id(df_play_list)\n\ndf_injury[['GameID', 'PlayKey']] = \\\ndf_injury[['GameID', 'PlayKey']].astype('int8')\ndf_injury['PlayerKey'] = df_injury['PlayerKey'].astype('int32')\n\ndf_play_list[['GameID', 'PlayKey']] = \\\ndf_play_list[['GameID', 'PlayKey']].astype('int8')\ndf_play_list['PlayerKey'] = df_play_list['PlayerKey'].astype('int32')\n\n\ndf_injury['status'] = 'injured'\n\n\n\n\ncol_filter_for_merge = ['PlayerKey', 'GameID', 'PlayKey',\n                        'RosterPosition', 'PlayerDay',\n                        'PlayerGame', 'StadiumType', 'FieldType',\n                        'Temperature', 'Weather','PlayType',\n                        'PlayerGamePlay', 'Position', 'PositionGroup']\n\ndf_play_list_merge = df_play_list[col_filter_for_merge].merge(\n    df_injury, on=['PlayerKey', 'GameID', 'PlayKey'], how='left')\n\ndf_play_list_merge['status'] = df_play_list_merge['status'].fillna('non injured')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Synthetic turf cause more injuries, but not all type of injuries!\nThis section is the first and main section of our analysis. We will find out how surface and environmental variable contributes to injuries. We previously know that surface type affects injuries. From research, we know that synthetic turf causes more injuries compared to natural turf. But we have to dig dive a little more details. "},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp = df_injury.groupby(['BodyPart', 'Surface'])['PlayerKey'].count().to_frame('counts').reset_index()\n\ntemp['Percentage'] = temp.groupby(['BodyPart'])['counts'].apply(percentage)\npx.bar(temp, y='Percentage', x='BodyPart', color='Surface', barmode='group')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"We are seeing very important results. Toes and Ankle are two major injuries that occurred most in synthetic turf and Foot and Heel injuries are prominent in natural turf. Why? \n\n![](https://orthoinfo.aaos.org/link/3071e352c90a4cfbae465a89cfb176bb.aspx)\n\nWe are seeing foot position when toe injury occurred. Because of \"Artificial turf is a harder surface than grass and does not have much \"give\" when forces are placed on it\" [1], and from research, we know that Synthetic turf surfaces do not release cleats as readily as natural turf  (Kent et al., 2015). That' why synthetic turf contributes more in toes and ankle injuries. \n\nOn the other hand, foot and heel injuries are prominent in natural turf. From medical research, we know that these two injuries happened because of uneven surfaces. One of the negative sides of natural turf is that it needs more maintenance. After using some moments the grass or field can get problems. One of the problems is surface becomes slightly bumpy or uneven. One of the main cause for foot and heel injury is uneven or bumpy surface. Because of the problem in natural grass, foot and heel injury is prominent in natural turf."},{"metadata":{},"cell_type":"markdown","source":"# High temperature contributes more to injuries"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"px.box(df_play_list_merge.loc[df_play_list_merge.Temperature != -999], y='Temperature', color='status', facet_col='FieldType')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"We are seeing that in both field type (synthetic and natural ), injured game field temperature is higher compared to the non-injured population. This means that the higher temperature is one of the reasons for player injury. Why? From medical research that higher temperature makes player fatigue quickly and the muscle got tired fast. For that reason, a player is more likely to get injured at high temperature. "},{"metadata":{},"cell_type":"markdown","source":"# Majority of the injuries occured in outdoor stadium"},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"stadium_type_dict = {'Indoors': 'Indoor', 'Oudoor': 'Outdoor', 'Outdoors': 'Outdoor', 'Domed, closed': 'Closed Dome', \n                    'Domed': 'Dome', 'Ourdoor': 'Outdoor', 'Outddors': 'Outdoor', 'Outdor': 'Outdoor', 'Dome, closed': 'Closed Dome',\n                    'Retr. Roof-Closed': 'Retr. Roof Closed', 'Retr. Roof-Open': 'Retr. Roof Open', 'Retr. Roof - Open': 'Retr. Roof Open',\n                    'Dome, closed': 'Closed Dome', 'Domed, open': 'Domed, Open', 'Outside': 'Outdoor', 'Retr. Roof - Closed': 'Retr. Roof Closed',\n                    'Closed Dome':'Dome', 'Domed, Open': 'Dome', 'Indoor, Open Roof': 'Ind', 'Closed Dome': 'Dome', 'Open': 'Outdoor',\n                    'Retr. Roof Closed': 'Retractable Roof', 'Retr. Roof Open': 'Retractable Roof', 'Outdoor Retr Roof-Open': 'Retractable Roof',\n                    'Indoor, Roof Closed':'Indoor', 'Ind': 'Indoor', 'Cloudy': 'Outdoor', 'Heinz Field': 'Outdoor', 'Bowl': 'Outdoor'}\ndf_play_list_merge = df_play_list_merge.replace(stadium_type_dict)\n\ntemp = df_play_list_merge.loc[df_play_list_merge.status == 'injured']\ntemp = temp.groupby(['StadiumType', 'FieldType'])['PlayerKey'].count().to_frame(name='counts').reset_index()\ntemp = temp.sort_values(['counts'], ascending=False)\ntemp['Percentage'] = temp.groupby(['FieldType'])['counts'].apply(percentage)\n\npx.bar(temp, x='StadiumType', y='Percentage', color='FieldType', barmode='group')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"We are seeing that the majority of the injuries occurred in the outdoor stadium. Almost all the injuries of natural turf occurred in the outdoor stadium and synthetic turf injuries are also mostly happened in an outdoor stadium. We still don't know the exact cause for this but maybe in future, we will find."},{"metadata":{},"cell_type":"markdown","source":"# 72% of the injuries happend during first 10 games of individual player\nWe previously saw how surface effect in injuries and how to reduce it. But we need to focus on very important thing, that is player previous playing history. "},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp = df_play_list_merge[df_play_list_merge.status == 'injured']['PlayerGame'].value_counts().to_frame('counts').reset_index()\ntemp = temp.rename(columns={'index': 'Player Game'})\ntemp['Percentage'] = percentage(temp['counts'])\npx.bar(temp, y='Percentage', x='Player Game')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"We are seeing very interesting and important results. 72% of injuries happened during the first 10 games of individual player. That means that player is not very experienced with the environment. Now for our curisity let's dig dive more. "},{"metadata":{},"cell_type":"markdown","source":"# 55% of injuries, the field was different from immediate previous game"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"df_play_list = df_play_list.sort_values(['PlayerKey', 'GameID', 'PlayKey', 'PlayerDay'])\ndf_play_list_first = df_play_list.drop_duplicates(['PlayerKey', 'GameID'], keep='first')\ndf_play_list_first = df_play_list_first.merge(df_injury, on=['PlayerKey', 'GameID'], how='left')\ndf_play_list_first['status'] = df_play_list_first['status'].fillna('non injured')\n\ndf_play_list_first['previous_field_type'] = df_play_list_first.groupby(['PlayerKey'])['FieldType'].shift(1)\n\n\ntemp = df_play_list_first.loc[df_play_list_first.status == 'injured']\ntemp['is_same_field'] = np.where(temp['previous_field_type']==temp['FieldType'], \n                                           'yes', 'no')\n\ntemp = temp.groupby(['FieldType', 'is_same_field'])['PlayerKey'].count().to_frame('counts').reset_index()\ntemp['Percentage'] = temp.groupby(['FieldType'])['counts'].apply(percentage)\n\npx.bar(temp, x='is_same_field', y='Percentage', color='FieldType', barmode='group')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"We are seeing very important results. 55% in injuries, field are different from the immediate previous field. And it goes up to 63% in synthetic turf. This is also one of the great findings of this notebooks analysis. This will help team, player and coach to prepare for such play that has different field from previous game so that player has less chance of getting injured. "},{"metadata":{},"cell_type":"markdown","source":"# Numer of Declaration, acceleration, no acceleration/deceleration in last 20 seconds\nWe previously know the differences in cleat-turf interactions, but it has yet to be determined whether player movement patterns and other measures of player performance differ across playing surfaces and how these may contribute to the incidence of lower limb injury.\n\nWe first need a way to characterize the player movement. To characterize player movement we have created several metrics. Now lets our first batch of movement metrics and how they affect injuries."},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"dataset = df_track_data.iloc[np.flatnonzero((df_track_data.event == 'ball_snap') | (df_track_data.event == 'kickoff'))[0]:]\ndataset['event'].ffill(inplace=True)\n\ndisplacement  = dataset[['x', 'y']].diff()\ndataset['displacement'] = np.sqrt(displacement.x**2 + displacement.y**2)\ndataset.displacement.iloc[0] = 0 # At the moment of ball_snap or kickoff, acceleration is likely 0\n\ndataset['speed'] = (dataset['displacement'] / .10).values\n\n\ndataset['a'] = (dataset.speed - dataset.speed.shift(1)) / .10\ndataset.a.iloc[0] = 0 # At the moment of ball_snap or kickoff, acceleration is likely 0\n\n\ndataset['dir_change'] = abs(dataset.dir - dataset.dir.shift(1))\ndataset['o_change'] = abs(dataset.dir - dataset.o.shift(1))\n\ndataset['dir_change'] = dataset['dir_change'].fillna(0)\ndataset['o_change'] = dataset['o_change'].fillna(0)\n\n\n\n\n\ndataset.loc[dataset.a < 0, 'acc_type'] = 'decelaration'\ndataset.loc[dataset.a == 0, 'acc_type'] = 'no accelaration'\ndataset.loc[dataset.a > 0, 'acc_type'] = 'accelaration'","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"num_declaration = calc_num_event(dataset, 'acc_type', 'decelaration', 200, 'num_decelaration')\n\ntemp = num_declaration.merge(df_play_list_merge, on=['PlayerKey', 'GameID', 'PlayKey'], how='inner')\nfinal = temp.groupby(['status', 'FieldType'])['num_decelaration'].mean().reset_index()\n\n\n\nnum_accelaration = calc_num_event(dataset, 'acc_type', 'accelaration', 200, 'num_accelaration')\n\ntemp = num_accelaration.merge(df_play_list_merge, on=['PlayerKey', 'GameID', 'PlayKey'], how='inner')\nfinal = final.merge(temp.groupby(['status', 'FieldType'])['num_accelaration'].mean().reset_index(), on=['status', 'FieldType'], how='inner')\n\n\nnum_no_accelaration = calc_num_event(dataset, 'acc_type', 'no accelaration', 200, 'num_no_accelaration')\n\ntemp = num_no_accelaration.merge(df_play_list_merge, on=['PlayerKey', 'GameID', 'PlayKey'], how='inner')\nfinal = final.merge(temp.groupby(['status', 'FieldType'])['num_no_accelaration'].mean().reset_index(), on=['status', 'FieldType'], how='inner')\n\n\nfinal = final.melt(id_vars=['status', 'FieldType'])\n\n\npx.bar(final, x='variable', y='value', color='status', facet_col='FieldType', barmode='group')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"We are seeing three-movement metrics by field and injury status. The number of deceleration, number of acceleration is higher in injured player compared to the non-injured player. But we are not seeing any significant differences in these metrics in different field type. "},{"metadata":{},"cell_type":"markdown","source":"# Mean acceleration, speed, distance, direction, orientation, directional changes and orientation changes"},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"temp = \\\ndataset\\\n.groupby(['PlayerKey', 'GameID', 'PlayKey'])\\\n.agg(mean_dis=('displacement', 'mean'),\n     mean_speed = ('speed', 'mean'),\n     mean_a = ('a', 'mean'),\n     mean_dir = ('dir', 'mean'),\n     mean_o = ('o', 'mean'),\n     mean_dir_change = ('dir_change', 'mean'), \n     mean_o_change = ('o_change', 'mean')).reset_index()\n\ntemp = temp.merge(df_play_list_merge,\n                  on=['PlayerKey', 'GameID', 'PlayKey'],\n                  how='inner')\n\ntemp = \\\ntemp\\\n.groupby(['status', 'FieldType'])[['mean_dis', 'mean_speed',\n                                   'mean_a','mean_dir',\n                                   'mean_o', 'mean_dir_change',\n                                   'mean_o_change']].mean().reset_index()\n\ntemp = temp.melt(id_vars=['status', 'FieldType'])\n\npx.bar(temp, x='variable', y='value', color='status', facet_col='FieldType', barmode='group')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"In here, we are seeing very important metrics and we should spend some time thinking about the results. Not all the metrics above are not important. The most important movement metrics are mean direction, mean orientation, mean directional changes and mean orientation changes. \n\nWe are seeing on natural turf injured player has higher mean direction and orientation but on synthetic turf injured player has less mean direction and orientation compared to the non-injured player. Secondly, we are seeing that injured player has higher directional and orientation changes compared to non-injured players in natural turf and slightly in synthetic turf. \n\nConclusion: We are seeing a high mean in direction, orientation changes. But we are not seeing any difference in different surface."},{"metadata":{},"cell_type":"markdown","source":"# Max acceleration, speed, distance, direction, orientation, directional changes and orientation changes"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp = \\\ndataset\\\n.groupby(['PlayerKey', 'GameID', 'PlayKey'])\\\n.agg(max_dis=('displacement', 'max'),\n     max_speed = ('speed', 'max'),\n     max_a = ('a', 'max'),\n     max_dir = ('dir', 'max'),\n     max_o = ('o', 'max'),\n     max_dir_change = ('dir_change', 'max'), \n     max_o_change = ('o_change', 'max')).reset_index()\n\ntemp = temp.merge(df_play_list_merge,\n                  on=['PlayerKey', 'GameID', 'PlayKey'],\n                  how='inner')\n\ntemp = \\\ntemp\\\n.groupby(['status', 'FieldType'])\\\n[['max_dis', 'max_speed','max_a',\n  'max_dir', 'max_o','max_dir_change',\n  'max_o_change']].mean().reset_index()\n\ntemp = temp.melt(id_vars=['status', 'FieldType'])\n\npx.bar(temp, x='variable', y='value',\n       color='status', facet_col='FieldType',\n       barmode='group')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Observations: We are seeing another 7 movement metrics. But among them one is important and that is max_a( max acceleration ). We are seeing max acceleration is way higher in injured player compared to the non-injured player. And the most important thing is that max acceleration also higher in synthetic turf compared to natural turf. "},{"metadata":{"trusted":true},"cell_type":"markdown","source":"# Conclusion\nFinally, we have come to an end. I just want to thank you for reading this notebook until last. We together explored different factors of injuries in the NFL. We have explored how surface, movement metrics and environmental factors affect injuries and most importantly we have provided proposals for reducing injuries based on our findings.\n\nI hope that these findings and proposal will help the NFL for reducing injuries and make football great sports just it always be. As always thanks for reading!"},{"metadata":{},"cell_type":"markdown","source":"References:\n\n[1] [https://orthoinfo.aaos.org/en/diseases--conditions/turf-toe](https://orthoinfo.aaos.org/en/diseases--conditions/turf-toe)\n\n[2] [https://en.wikipedia.org/wiki/Cleat_(shoe)](https://en.wikipedia.org/wiki/Cleat_(shoe))"}],"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":4,"nbformat_minor":1}