<jupyter_start><jupyter_text>Exploratory DataThis notebook is intended to explore our dataset and look for different features.<jupyter_code>from scripts.project_functions import *
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
sns.set_theme(style = "darkgrid",
              font_scale = 1.25)
df = load_and_process('../data/raw/combine_data.csv')
df<jupyter_output><empty_output><jupyter_text>Let's explore with describe.<jupyter_code>df.describe().T<jupyter_output><empty_output><jupyter_text>We start with a height versus weight for all players<jupyter_code>sns.regplot(x = 'Ht', y = 'Wt', data=df)<jupyter_output><empty_output><jupyter_text>This is expected. There looks to be a positive correllation between height and weight. As height increases (the independent variable) so does weight.Let's get a feel for which position of player is most represented in the data<jupyter_code>sns.countplot(x="Pos",
              data=df,
              order = df['Pos'].value_counts().index)<jupyter_output><empty_output><jupyter_text>Wide receivers are the most represented position in our dataset. I think it is interested the cornerbacks are number 2. Typically cornerbacks are just as fast and quick as wide receivers but cannot catch as well.Let's explore the height and weight of the different positions<jupyter_code>sns.violinplot(data = df, y = "Ht", x = "Pos")<jupyter_output><empty_output><jupyter_text>I think there are too many positions here. Let's focus on Wide Receivers, Cornerbacks and Quarterbacks; we'll call this set 1.<jupyter_code>set1 = df[(df['Pos'] == 'WR') | (df['Pos'] == 'CB') | (df['Pos']=='QB')]
sns.violinplot(data = set1, y = "Ht", x = "Pos")<jupyter_output><empty_output><jupyter_text>Wow. Look at the height distribution of the wide receiver especially compared to the cornerbacks. The CBs cover the wide receivers. The median height for WR is also a few inches more than the that of CBs.QBs are typically taller than both CB and WR. Maybe this is so they can over their offensive line and see more of the field. Since height is correlated to weight, I'd image the violin plot with weight would look very similar. Why not do it?<jupyter_code>sns.violinplot(data = set1, y = "Wt", x = "Pos")<jupyter_output><empty_output><jupyter_text>Yes it is pretty close. Wow, a nearly 300 pound quaterback? Interesting. Let's find it.<jupyter_code>(df.loc[lambda x: x['Pos'] == 'QB']
    .loc[lambda x: x['Wt'] > 250])<jupyter_output><empty_output><jupyter_text>There we go. <NAME> in the 2004 combine. He was not drafted. Interestingly, <NAME> is 265 pounds which looks to be the heaviest QB that was drafted between 2000-2017. He went first overall too!Let's look at the average weight of all the positions.<jupyter_code>average_weight_by_position = (df
.groupby(['Pos'])
.mean()['Wt']
.to_frame()
.reset_index() 
.sort_values(by=['Wt'],ascending=False))
average_weight_by_position<jupyter_output><empty_output><jupyter_text>For fun, what is the heaviest player at the combine. I'll bet it was a Offensive lineman.<jupyter_code>df['Wt'].argmax()

df.loc[950:950]<jupyter_output><empty_output><jupyter_text>Yep, an offensive tackle that was picked 4th overall in 2002 by the Bills.Let's explore draft picks and let's say quarterback's athletic performance. Let's get some benchmarks first.<jupyter_code>QB_data = df[df['Pos']=='QB']
QB_data.describe()<jupyter_output><empty_output><jupyter_text>Let's take a look at some scatterplots<jupyter_code>sns.relplot(x = "Forty", y = "Round", data = QB_data)
sns.relplot(x = "Vertical", y = "Round", data = QB_data)
sns.relplot(x = "BroadJump", y = "Round", data = QB_data)
sns.relplot(x = "Cone", y = "Round", data = QB_data)
sns.relplot(x = "Shuttle", y = "Round", data = QB_data)<jupyter_output><empty_output><jupyter_text>These seem pretty inconclusive. Note that the 10th round means that the player was not drafted. Yet in the case of the cone drill the fastest time was by an undrafted QB. I did not do the benchreps as this is more of a test for an lineman. I wonder if a weight average of some kind may give some insights?Next, some more exploring using the pairplot. I am most interested in the round data.<jupyter_code># I want the round column here
QBPair = QB_data.drop(['Year', 'AV', 'Team' ], axis=1)
sns.pairplot(data = QBPair.iloc[:,4:11])<jupyter_output><empty_output><jupyter_text>I guess this is why it is called exploratory :-) Lots of interesting correlations here. Some correlations:-Broadjump and vertical (jumping)-Forty and the shuttle (agility)-cone and shuttle (agility)Interesting:-Forty and Broadjump have a negative correlations<jupyter_code># corrolatio plot
# figured out how to make the plot bigger!
plt.figure(figsize = (10,10))
corr = df.corr()
sns.heatmap(corr,square = True, linewidths = 0.5, cbar_kws = {"shrink": 0.6})<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10734001226742998, 'fraction_numerical': 0.011040686976078512, 'mean_word_length': 5.673942701227831, 'pattern_counts': {'":': 1, '<': 59, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '240345', 'license': 'MIT', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1559, 'n_words': 551, 'path': 'analysis/milestone2.task4.ipynb', 'repo_name': 'data301-2020-winter2/course-project-solo_112', 'size': '4909'}