The game of professional basketball has changed greatly throughout the years. Throughout history, it has been generalized that basketball is a game meant for people who are tall. However, the introduction of the 3 point line and rules to make the game less physical have made it easier for smaller players to excel. 3 pointers being worth more than 2 pointers caused teams to shoot more 3 pointers and draft more 3 point shooters. A player’s height becomes less relevant if they are a good 3 point shooter. The 2016 MVP Steph Curry is only 6 foot 2; but, his ability to shoot the 3, and the fact that the league was less physical allowed him to excel despite his height. In 1980, a player of his size would have more trouble scoring due to how physical the league was, and how the game was played closer to the basket. The objective of my project is to illustrate the differences between the effect of height on win percentage in the year 1980 and the year 2020. Has ‘small ball’ really taken over the NBA?
The first step is to get the average height of each NBA team along with their win percentage. I used the ‘requests get’ function with a url that contains the table with my desired data. The first parameter of the request get function is that url while the second parameter contains my headers to bypass any security preferences. When performing a get request, a website expects a valid user agent which is why I have my mac user agent in my headers array. The request get function returns the data from the url in html format. Beautiful soup is then used to convert the data into a more readable format where the beautiful soup function ‘find’ is used with ‘prettify’ to locate the table. Prettify() allows us to use the ‘table’ keyword to find the table. I then use pandas read html function to convert this table into a pandas data frame. This process is repeated for every single team in the year 2020, and the year 1980. Alas, data on team heights are in separate tables so I had to do a request for every team. This is not the best practice and I would not have done it this way if I had all my data in one table. Here are some helpful links:
Pandas Scraping
Pandas Array Slicing
Numpy Documentation
Once I have my data in a pandas data frame, I can access the heights of any specific team by the column name ‘Ht’. For each team, I convert the Heights into inches in a method which returns an array player heights in inches. I then use the numpy mean function to get the mean of that array; that gives me my x values aka the average height for each team. The y value is a team's win percentage, which I input manually from basketball reference since there is no need to scrape this from any table. For every single team, I append their average height to an array of my x values and their corresponding win percentage to an array of y values. I now have the average height for each team in 1980 and 2020 and a corresponding win percentage array for each team in 1980 and 2020.
#Scrape the data
import requests
from bs4 import BeautifulSoup as b
import html
import pandas as pandas
import numpy as np
def htoint(t):
x = []
for i in range(len(t)):
h = float(t[i][0])*12 + float(t[i][2])
x.append(h)
return x
ht_X = [] #the mean height
multi_ht_X = [] #all the players heights for multiple linear regression
wp_Y = []
#How has height effected NBA win percentage in 2019-2020?
#Eastern Conference
#Bucks
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FMIL%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(56/73)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Raptors
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FTOR%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(53/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Celtics
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FBOS%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(48/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Pacers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FIND%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(45/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Heat
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FMIA%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(44/73)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#76ers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FPHI%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(43/73)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Nets
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FBRK%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(35/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Magic
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FORL%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(33/73)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Hornets
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FCHO%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(23/65)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Wizards
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FORL%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(25/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Bulls
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FCHI%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(22/65)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Knicks
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FNYK%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(21/66)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Pistons
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FDET%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(20/66)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Hawks
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FATL%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(20/67)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Cavs
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FCLE%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(19/65)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Western Conference
#Lakers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FLAL%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(52/71)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Clippers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FLAC%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(49/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Nuggets
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FDEN%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(46/73)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Rockets
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FHOU%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(44/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#OKC
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FOKC%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(44/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Jazz
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FUTA%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(44/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Mavs
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FDAL%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(43/75)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Blazers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FPOR%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(35/74)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Grizzles
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FMEM%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(34/73)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Suns
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FPHO%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(34/73)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Spurs
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FSAS%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(32/71)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Kings
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FSAC%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(31/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Pelicans
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FNOP%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(30/72)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Timberwolves
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FMIN%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(19/64)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
#Warriors
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FGSW%2F2020.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = float(15/65)*100
ht_X.append(x)
wp_Y.append(y)
multi_ht_X.append(htoint(t))
height2020 = ht_X
winpct2020 = wp_Y
ht_X = []
wp_Y = []
#How has height effected NBA win percentage in 1979-1980?
#Eastern Confernce
#Celtics
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FBOS%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .774
ht_X.append(x)
wp_Y.append(y)
#76ers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FPHI%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .720
ht_X.append(x)
wp_Y.append(y)
#Bullets
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FWSB%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .476
ht_X.append(x)
wp_Y.append(y)
#Knicks
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FNYK%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .476
ht_X.append(x)
wp_Y.append(y)
#Nets
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FNJN%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .415
ht_X.append(x)
wp_Y.append(y)
#Hawks
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FATL%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .610
ht_X.append(x)
wp_Y.append(y)
#Rockets
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FHOU%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .500
ht_X.append(x)
wp_Y.append(y)
#Spurs
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FSAS%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .500
ht_X.append(x)
wp_Y.append(y)
#Pacers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FIND%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .451
ht_X.append(x)
wp_Y.append(y)
#Cavs
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FCLE%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .451
ht_X.append(x)
wp_Y.append(y)
#Pistons
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FDET%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .195
ht_X.append(x)
wp_Y.append(y)
#Bucks
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FMIL%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .598
ht_X.append(x)
wp_Y.append(y)
#Kings
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FKCK%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .573
ht_X.append(x)
wp_Y.append(y)
#Nuggets
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FDEN%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .366
ht_X.append(x)
wp_Y.append(y)
#Bulls
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FCHI%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .366
ht_X.append(x)
wp_Y.append(y)
#Jazz
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FUTA%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .293
ht_X.append(x)
wp_Y.append(y)
#Lakers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FLAL%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .732
ht_X.append(x)
wp_Y.append(y)
#Sonics
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FSEA%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .683
ht_X.append(x)
wp_Y.append(y)
#Suns
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FPHO%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .671
ht_X.append(x)
wp_Y.append(y)
#Blazers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FPOR%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .463
ht_X.append(x)
wp_Y.append(y)
#Clippers
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FSDC%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .427
ht_X.append(x)
wp_Y.append(y)
#Warriors
url = 'https://widgets.sports-reference.com/wg.fcgi?css=1&site=bbr&url=%2Fteams%2FGSW%2F1980.html&div=div_roster'
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15'}
req = requests.get(url,headers=headers) #the html data
root = b(req.content,'html')
tab = root.find("table").prettify()
table = pandas.read_html(tab)[0]
t = table['Ht']
x = np.mean(htoint(t))
y = .293
ht_X.append(x)
wp_Y.append(y)
y = []
for i in range(len(wp_Y)):
y.append(wp_Y[i]*100)
height1980 = ht_X
winpct1980 = y
Before analyzing the relationship between height and win percentage, I illustrate the distributions of height and win percentage. I do this by making 2 violin plots. Seaborn is a Python data visualization library based on matplotlib that makes it simple and easy to make a violin plot. I also use matplotlib's plt.figure to separate the two plots. Here are some helpful links:
Seaborn Violin Plot
Multiple Plots
#Visually Exploring the Data
import seaborn as sns
years = []
for i in range(len(height1980)):
years.append(1980)
for i in range(len(height2020)):
years.append(2020)
heights = height1980 + height2020
winpcts = winpct1980 + winpct2020
plt.figure(1)
sns.violinplot(x = years, y = heights)
plt.title('Height Distrubution in 1980 and 2020')
plt.figure(2)
sns.violinplot(x = years, y = winpcts)
plt.title('Win % Distrubution in 1980 and 2020')
plt.show()
Violin plots are a great way to visualize the distribution of data. Wider sections of the violin plot represent a higher probability that members of the population
will take on the given value, while the thinner sections represent a lower probability. Here is a helpful link to interpret violin plots:
Violin Plot Interpretation
The first violin plot shows the distribution of heights in the year 1980 and the year 2020.
Height is more evenly distributed in the year 1980 across the interquartile range, while in the year 2020, much more teams have heights closer to the median as represented by the wider section of the 2020 height violin plot.
Additionally, the tallest team in 2020 is taller than the tallest team in 1980 and the median height for 2020 is also slightly higher than the median height for 1980. Both team's height outliers, represented by the two ends of each violin plot, are around the same.
In 1980, the teams win % is more distributed closer to the median and above it, while in 2020 the win percentage is more evenly distributed. To add on, the minimum win % in 1980 is lower than the minimum win % in 2020 and the maximum win % in 1980 is greater than the maximum win % in 2020, as represented by the ends of the violin plots.
In 1980, since height is evenly distributed and many of the teams in 1980 have win %s closer to and above the median, teams with higher win percentages could be taller than teams with lower win percentages. This would lead me to believe that height may have
more of an effect on win percentage in 1980 than in 2020. In 2020, the fact that the teams heights are closer together and win percentage
is more evenly distributed means that teams with heights closer to each other have a higher chance of having different win percentages.
#Linear Regression
import matplotlib.pyplot as plt
X = np.array(height1980).reshape(-1,1)
x = np.array(height1980).reshape(-1,1)
y = np.array(winpct1980).reshape(-1,1)
ones = np.ones([X.shape[0],1])
X = np.concatenate([ones,X],1)
a,b = np.linalg.solve(X.T.dot(X), X.T.dot(y))
print("Intercept:",a)
print("Slope:",b)
plt.figure(3)
plt.plot(x,y,'o')
plt.plot(x, a+b*x)
plt.title('Win% vs Height in Inches in 1980')
plt.xlabel('Height')
plt.ylabel('Win%')
plt.show()
X = np.array(height2020).reshape(-1,1)
x = np.array(height2020).reshape(-1,1)
y = np.array(winpct2020).reshape(-1,1)
ones = np.ones([X.shape[0],1])
X = np.concatenate([ones,X],1)
a,b = np.linalg.solve(X.T.dot(X), X.T.dot(y))
print("Intercept:",a)
print("Slope:",b)
plt.figure(4)
plt.plot(x,y,'o')
plt.plot(x, a+b*x)
plt.title('Win% vs Height in Inches in 2020')
plt.xlabel('Height')
plt.ylabel('Win%')
plt.show()
Intercept: [-95.54570895] Slope: [1.89321239]
Intercept: [294.85120304] Slope: [-3.18168388]
#Manupulation and Exploration to prepare for Logistic Regression
win1980bins = []
win2020bins = []
for i in range(len(winpct1980)):
if float(winpct1980[i]) > 45:
win1980bins.append(1)
else:
win1980bins.append(0)
for i in range(len(winpct2020)):
if int(winpct2020[i]) > 45:
win2020bins.append(1)
else:
win2020bins.append(0)
plt.figure(5)
plt.plot(height1980,win1980bins,'o')
plt.title("Logistic Plot of Win % vs Height 1980")
plt.show()
plt.figure(6)
plt.plot(height2020,win2020bins,'o')
plt.title("Logistic Plot of Win % vs Height 2020")
plt.show()
#Logistic Regression
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import KFold
from sklearn.model_selection import cross_val_score
X = np.array(height1980).reshape(-1,1)
X1 = np.array(height2020).reshape(-1,1)
model1980 = LogisticRegression(solver='newton-cg', random_state=0).fit(X,win1980bins)
ldamodel1980 = LinearDiscriminantAnalysis(solver='lsqr').fit(X,win1980bins)
model2020 = LogisticRegression(solver='newton-cg', random_state=0).fit(X1,win2020bins)
ldamodel2020= LinearDiscriminantAnalysis(solver='lsqr').fit(X1,win2020bins)
cv = KFold(n_splits=7, random_state=1, shuffle=True)
model1980CV = cross_val_score(model1980, X, win1980bins, scoring='accuracy', cv=cv, n_jobs=-1,error_score='raise')
model2020CV = cross_val_score(model2020, X1, win2020bins, scoring='accuracy', cv=cv, n_jobs=-1,error_score='raise')
cvmean1980 = np.mean(model1980CV)
cvmean2020 = np.mean(model2020CV)
ldamodel1980CV = cross_val_score(ldamodel1980, X, win1980bins, scoring='accuracy', cv=cv, n_jobs=-1,error_score='raise')
ldamodel2020CV = cross_val_score(ldamodel2020, X1, win2020bins, scoring='accuracy', cv=cv, n_jobs=-1,error_score='raise')
cvLmean1980 = np.mean(ldamodel1980CV)
cvLmean2020 = np.mean(ldamodel2020CV)
print("1980 Logsitic Regression Cross Val Score: ",cvmean1980)
print()
print("2020 Logsitic Regression Cross Val Score: ",cvmean2020)
print()
print()
print("1980 LDA Cross Val Score: ",cvLmean1980)
print()
print("2020 LDA Cross Val Score: ",cvLmean2020)
print()
print()
small = [75] * 30
big = [78] * 30
s = np.array(small).reshape(-1,1)
b = np.array(big).reshape(-1,1)
print("1980 Logistic Small Teams Predictions:",model1980.predict(s))
print()
print("1980 Logistic Big Teams Predictions:",model1980.predict(b))
print()
print()
print("2020 Logistic Small Teams Predictions:",model2020.predict(s))
print()
print("2020 Logistic Big Teams Predictions:",model2020.predict(b))
print()
print()
print("1980 LDA Small Teams Predictions:",ldamodel1980.predict(s))
print()
print("1980 LDA Big Teams Predictions:",ldamodel1980.predict(b))
print()
print()
print("2020 LDA Small Teams Predictions:",ldamodel2020.predict(s))
print()
print("2020 LDA Big Teams Predictions:",ldamodel2020.predict(b))
1980 Logsitic Regression Cross Val Score: 0.6785714285714286 2020 Logsitic Regression Cross Val Score: 0.5285714285714286 1980 LDA Cross Val Score: 0.6309523809523808 2020 LDA Cross Val Score: 0.5285714285714286 1980 Logistic Small Teams Predictions: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1980 Logistic Big Teams Predictions: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 2020 Logistic Small Teams Predictions: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 2020 Logistic Big Teams Predictions: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1980 LDA Small Teams Predictions: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1980 LDA Big Teams Predictions: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 2020 LDA Small Teams Predictions: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 2020 LDA Big Teams Predictions: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
The 1980 cross-val score for both models was higher than the 2020 cross-val score for both models. The Logistic Regression Model had a better cross-val score for the year 1980 than the LDA model for the year 1980 while the 2020 cross-val score was the same for both models. The fact the the Logistic Regression Model's cross-val score for the year 1980 is 15% higher than its cross-val score for the year 2020 leads me to believe that there is a stronger correlation between height and win percentage in the year 1980 than in the year 2020 which supports my hypothesis. Unfortunately, neither of the models had a high cross-val score for either of the years. This means that the correlation between height and win percentage is not very strong, except for the Logistic Regression model's cross-val score of .678 for the year 1980. Nevertheless, using the models to predict weather the win percentages for small and big teams supported my hypothesis. Both 1980 models predicted that small teams would have a win % below 45% and that big teams would have a win % above 45%. Both the 2020 models predicted the exact opposite; that small teams would have a win % above 45% and that big teams would have a win % below 45%
All you need to do to make sense of data is to read up on Python's libraries like pandas, numpy, sklearn, read up on different types of regression analysis, and follow this tutorial. Reflecting back on my initial hypothesis, the Linear Regression line showed a positive correlation between height and win% in 1980 and a negative one in 2020. The Logistic Regression analysis illustrated that height defined a team's success more in 1980 than in 2020, and showed the same correlations as the Linear Regression Model. The cross-val score of .52 for the 2020 Logistic Models leads me to believe that the correlation between height and win% in 2020 is too small to fully accept my hypothesis. Thus, I accept 2/3 parts of my initial hypothesis; I accept that height is positively correlated with win% in 1980, and that the correlation between height and win% is stronger in 1980 than in 2020. In 2020, there was not as much of a correlation between height and win percentage because of how the game has changed. Jump shots and 3 pointers have taken over the game where as in 1980 more players tried to score closer to the basket. Players who are taller tend to be better at scoring closer to the basket than smaller players. This is why height seems to have a stronger effect on win percentage in 1980 than in 2020. The 2020 Logistic Regression model had a smaller score than the 1980 model because in 2020 players of all heights can shoot jump shots and 3 pointers; making height less relevant in 2020. All in all, it seems that 'small ball' hasn't exactly taken over; but, 'tall ball' has diminished.