Malcolm J Gyagenda June 06, 20115
I hope to learn how to use set up histograms, scatter plots, and also use simple statistics functions like min, max, standrad deviation in python I also hope to learn how to create and update repositories using data from the National Basketball Association which includes height, weight, team, birht city and jersey number
The variables of interest are weight of the player and the age of the player. How the old the player is versus how much they weigh. Do the older players weight more than the younger ones and viceversa
import pandas as pd
import numpy as np
s=pd.Series()
print(s)
nba=pd.read_csv("nba_rosters_2017_18.csv")
# print(nba.head())
nba_sub = nba[nba['Age']>0 & (nba['Weight']>0)]
print(len(nba))
print(len(nba_sub))
nba_sub.head()
plt.scatter(df_sub["Weight"], df_sub["Age"])
#weight = nba_sub['Age','Weight']
young_sample = nba_sub[nba_sub["Age"]<30]
#old_sample = nba_sub[nba_sub["Age"]>=30]
young_sample.describe()
#old_sample.describe()
y_wt = np.mean(young_sample['Weight'])
o_wt = np.mean(old_sample['Weight'])
print("Young:", y_wt, "\nOld:", o_wt)
print(nba[600:610])
print(nba["Weight"][600:610])
print(nba["Age"][600:610])
print(nba["Age"][600:610].describe())
print(nba["Weight"][600:610].describe())
print(type(Weight))
#Weight=(nba["Weight"][600:610])
print(sum(Weight.isnull()))
Age=(nba["Age"][600:610])
print(sum(Age.isnull()))
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.hist(Age)
fig2=plt.figure()
plt.scatter(Age,Weight)
plt.show()