<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Data BootCamp Project
Step1:  Who has Grit?
Hockey has always been a eloquent yet brutal sport, in this analysis I'm finding the player that embodies the brutality.
Step2:  AHHH
The graph above is the simplest display of my data. Out of roughly 900 NHL players, only a few are recognizeable from the mass.
Step3:  This is the way my quantitative data looks. Most of the column headers are self explanatory, but i'll go into further detail later.
Step4:  Above is the quantitative means of the data i've acquired. Grit is a weighted compilation of penalty minutes, hits, blocked shots, and fights (making it somewhat subjective).
Step5:  Since i'm primarily interested in players with the most Grit, i'm going to limit my searches to a higher percentile.
Step6:  Of the original 900, these are the 10 players with the most Grit.
Step7:  Above is how my qualitative data is structured. I've seperated the datasets for ease of manipulation.
Step8:  Above are the hardiest players in the NHL, but how do they perform?
Step9:  The two graphs above represent hits given and hits received respectively.
Step10:  The above graph reflects the amount of games played during the season. The x-axis is simply the index value attributed to the player.
<ASSISTANT_TASK:>
Python Code:
import pandas as pd #PandasPandas
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
print('PandaPandaPanda ', pd.__version__)
df=pd.read_csv('NHLQUANT.csv')
Explanation: Data BootCamp Project
End of explanation
plt.plot(df.index,df['Grit'])
Explanation: Who has Grit?
Hockey has always been a eloquent yet brutal sport, in this analysis I'm finding the player that embodies the brutality.
End of explanation
df.head(10)
Explanation: AHHH
The graph above is the simplest display of my data. Out of roughly 900 NHL players, only a few are recognizeable from the mass.
End of explanation
df.mean()
Explanation: This is the way my quantitative data looks. Most of the column headers are self explanatory, but i'll go into further detail later.
End of explanation
pd.to_numeric(df, errors='ignore')
y=df["Age"]
z=df["Grit"]
plt.plot(y,z)
df['Grit']>130
df.ix[df['Grit']>130]
Explanation: Above is the quantitative means of the data i've acquired. Grit is a weighted compilation of penalty minutes, hits, blocked shots, and fights (making it somewhat subjective).
End of explanation
df.ix[df['Grit']>300]
df.ix[df['Grit']>400]
Best=df.ix[df['Grit']>400]
Best.sort("Age").plot.barh('Age',"Grit")
Explanation: Since i'm primarily interested in players with the most Grit, i'm going to limit my searches to a higher percentile.
End of explanation
QL=pd.read_csv("NHLQUAL.csv")
QL.head(5)
Explanation: Of the original 900, these are the 10 players with the most Grit.
End of explanation
print(QL.at[61, "First Name"]+QL.at[61, 'Last Name'],QL.at[94, 'First Name']+QL.at[94, 'Last Name'],
QL.at[712, "First Name"]+QL.at[712, "Last Name"],QL.at[209, 'First Name']+QL.at[209, 'Last Name'],QL.at[306, "First Name"]+QL.at[306, 'Last Name'],QL.at[497, 'First Name']+QL.at[497, 'Last Name'],QL.at[524, 'First Name']+QL.at[524, 'Last Name'],QL.at[565, 'First Name']+QL.at[565, 'Last Name'],QL.at[641, 'First Name']+QL.at[641, 'Last Name'],QL.at[877, 'First Name']+QL.at[877, 'Last Name'])
Explanation: Above is how my qualitative data is structured. I've seperated the datasets for ease of manipulation.
End of explanation
Best.sort("Age").plot.barh('Age',"HitF")
Best.sort("Age").plot.barh('Age',"HitA")
Explanation: Above are the hardiest players in the NHL, but how do they perform?
End of explanation
Best.plot(Best.index ,'GP')
plt.ylim([60,85])
Explanation: The two graphs above represent hits given and hits received respectively.
End of explanation
fig, ax=plt.subplots(nrows=2, ncols=1, sharex=True, sharey=True)
Best['G'].plot(ax=ax[0],color='green')
Best['A'].plot(ax=ax[1],color='red')
Explanation: The above graph reflects the amount of games played during the season. The x-axis is simply the index value attributed to the player.
End of explanation
<END_TASK>