{"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"WNCAA_df = pd.read_csv('../input/wncaa-data/WNCAA_data.csv')\nIncreased_WNCAA_df = pd.read_csv('../input/wncaa-data/WNCAA_data.csv')\nDecreased_WNCAA_df = pd.read_csv('../input/wncaa-data/WNCAA_data.csv')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"A common pickup basketball rule modification is to change the value of 3 pointers to 2 and 2 pointers to 1. For our analysis, we wanted to explore what would happen if we applied these rule changes to WNCAA tournament, and if that would change the winner of any of the games. We wanted to see what the impact would be of modifying the ratio between the value of different types of shots. "},{"metadata":{"trusted":true},"cell_type":"code","source":"WNCAA_df.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"WNCAA_df.columns","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"WNCAA_df.shape","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Here, we added variables that told us how many points in a game were earned by 2 point shots and 3 point shots."},{"metadata":{"trusted":true},"cell_type":"code","source":"WNCAA_df['WPoints_From_2'] = WNCAA_df['WFGM2']*2\nWNCAA_df['LPoints_From_2'] = WNCAA_df['LFGM2']*2\nWNCAA_df['WPoints_From_3'] = WNCAA_df['WFGM3']*3\nWNCAA_df['LPoints_From_3'] = WNCAA_df['LFGM3']*3","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"WNCAA_df.head()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Here, we are adding two new datasets, Decreased_WNCAA_df and Increased_WNCAA_df. In Decreased_WNCAA_df 3 point shots are worth only 2 points and 2 point shots are worth only 1 point. This makes 3 point shots worth proportionatly more than 2 point shots. In Increased_WNCAA_df 3 point shots are worth 4 points and 2 point shots are worth 3 points. In the future we would also like to examine the effects of free throws, to make our analysis more robust."},{"metadata":{"trusted":true},"cell_type":"code","source":"Decreased_WNCAA_df['WPoints_From_2'] = WNCAA_df['WFGM2']*1\nDecreased_WNCAA_df['LPoints_From_2'] = WNCAA_df['LFGM2']*1\nDecreased_WNCAA_df['WPoints_From_3'] = WNCAA_df['WFGM3']*2\nDecreased_WNCAA_df['LPoints_From_3'] = WNCAA_df['LFGM3']*2\n\nDecreased_WNCAA_df['New_WScore'] = Decreased_WNCAA_df['WPoints_From_2'] + Decreased_WNCAA_df['WPoints_From_3'] + Decreased_WNCAA_df['WFTM'] \nDecreased_WNCAA_df['New_LScore'] = Decreased_WNCAA_df['LPoints_From_2'] + Decreased_WNCAA_df['LPoints_From_3'] + Decreased_WNCAA_df['LFTM'] \n\nDecreased_WNCAA_df['score_dif'] = Decreased_WNCAA_df['New_WScore'] - Decreased_WNCAA_df['New_LScore']\n\nDecreased_WNCAA_df.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Increased_WNCAA_df['WPoints_From_2'] = WNCAA_df['WFGM2']*3\nIncreased_WNCAA_df['LPoints_From_2'] = WNCAA_df['LFGM2']*3\nIncreased_WNCAA_df['WPoints_From_3'] = WNCAA_df['WFGM3']*4\nIncreased_WNCAA_df['LPoints_From_3'] = WNCAA_df['LFGM3']*4\n\nIncreased_WNCAA_df['New_WScore'] = Increased_WNCAA_df['WPoints_From_2'] + Increased_WNCAA_df['WPoints_From_3'] + Increased_WNCAA_df['WFTM'] \nIncreased_WNCAA_df['New_LScore'] = Increased_WNCAA_df['LPoints_From_2'] + Increased_WNCAA_df['LPoints_From_3'] + Increased_WNCAA_df['LFTM'] \n\nIncreased_WNCAA_df['score_dif'] = Increased_WNCAA_df['New_WScore'] - Increased_WNCAA_df['New_LScore']\n\nIncreased_WNCAA_df.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Increased_Winner_Changes = Increased_WNCAA_df[Increased_WNCAA_df.score_dif <= 0].groupby(['Season']).size()\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Decreased_Winner_Changes = Decreased_WNCAA_df[Decreased_WNCAA_df.score_dif <= 0].groupby('Season').size()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"ax = Increased_Winner_Changes.plot.bar(y = 'Games Where Winner Changed')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Here, we can see that by simply increasing the value of 3s to 4 and 2s to 3 (hence, decreasing the ratio between the different shot types) the outcome of several games in each season would have changed. By making 2s more valuable, highly offensive teams that rely on 3 point shots are at a disadvantage. "},{"metadata":{"trusted":true},"cell_type":"code","source":"ax2 = Decreased_Winner_Changes.plot.bar()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Similarly, here we can see that by decreasing the value of 3s to 2 and 2s to 1 (hence, increasing the ratio between 3s and 2s), a similar number of games would have changed outcome. It is likely that teams that favor long distance shooting have the advantage in this scenario. "},{"metadata":{},"cell_type":"markdown","source":"One other thing to consider, however, is the role of the free throw shot. We did not at all change the value of free throws in this analysis. By decreasing the point value of each regular shot, we are essentially making free throws more valuable as well. Furthermore, a player would still get their typical 2 free throws for a shooting foul, effectively making a foul worth more than actually scoring. Physically imposing teams that are able to draw more fouls would likely have the upper hand in this scenario."},{"metadata":{},"cell_type":"markdown","source":"From this analysis, we can conclude that the value ratio between the different types of shots plays an important role in a team's performance and strategy. If the score of each shot were increased by 1 point, the number of wins in each year would have changed by a total of 26. If the score is decreased by 1 point, the number of wins in each year would have changed by a total of 36. Thus, fouls play a larger role when scores are decreased, in which case we would recommend avoiding fouling as much as possible. The same may be said when increasing each shot by 1 point; however, fouls play a smaller role in this scenario."},{"metadata":{},"cell_type":"markdown","source":"So when it comes to basketball shot selection, your decision should depend on how much your shot is worth. The women’s NCAA may consider our conclusions when deciding if they would like to make a change to sportsmanship."}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.7.6"}},"nbformat":4,"nbformat_minor":4}