<jupyter_start><jupyter_text>This data was collected from Wikipedia. Every stroke was initially seperated into its own data table so I used excel to combine it all into one big table. The columns "Gender" and "Stroke" and "Country were all added to the table table using excel. This allowed me to better represent the data by gender, event, and country.The column "Location" has the name of the of the city and country separated by a comma. For my purposes I only wanted the name of the country for each record set. I know that it is possible to loop through each row and only take the value after the comma but I could not get the code to work properly. So, instead I made a new column named "Country" and inserted the name of the country that each world record holder represented for. After cleaning the data I presented it as shown above.<jupyter_code>#CHANGE FEMALE COLOR
#Displays the Age range and amount of athletes at that range for each stroke
sns.set(style="darkgrid")
#creates a small multiple by using FacetGrid
g = sns.FacetGrid(df, hue="Gender", col="Stroke",col_wrap=2, height = 3)

bins = np.linspace(0, 50, 10)
g.map(plt.hist, "Age", bins=bins)
g.add_legend();
#This shows the rate at which swimmers are improving each year
df = df.dropna()
g = sns.FacetGrid(df,col="Gender", hue="Stroke", aspect=1.8, height=4, col_wrap=1)
g.map(plt.plot, "Date", "Time")
plt.subplots_adjust(top=0.9)
g.fig.suptitle('Figure 2: World Record Progression')
g.axes[0].get_xaxis().get_major_formatter().set_useOffset(False)
g.add_legend();
#Displays the average age for each Category of sport in the Olympics
grid = sns.FacetGrid(df2, col="Type", col_wrap=5)
bp = grid.map(sns.barplot,"avg_age","Sport","Gender")
grid.axes[0].legend()
#Plot the Regression for Time vs Age
#Now make small multiple for each stroke
df = df.dropna()
g = sns.regplot(x=df["Age"], y=df["Time"], color="r")

import statsmodels.api as sm
df = df.dropna()

X = df["Age"]
Y = df["Time"]

model = sm.OLS(Y,X).fit()
print(model.summary())<jupyter_output>OLS Regression Results                            
==============================================================================
Dep. Variable:                   Time   R-squared:                       0.958
Model:                            OLS   Adj. R-squared:                  0.958
Method:                 Least Squares   F-statistic:                     2735.
Date:                Fri, 14 Dec 2018   Prob (F-statistic):           5.83e-84
Time:                        21:40:20   Log-Likelihood:                -368.30
No. Observations:                 120   AIC:                             738.6
Df Residuals:                     119   BIC:                             741.4
Df Model:                           1                                         
Covariance Type:            nonrobust                                         
==============================================================================
                 coef    std err          t      P>|[...]
{'fraction_non_alphanumeric': 0.14004668222740912, 'fraction_numerical': 0.022340780260086696, 'mean_word_length': 2.4482758620689653, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '398179', 'license': 'MIT', 'n_tokens_mistral': 906, 'n_tokens_neox': 818, 'n_words': 320, 'path': 'Adams-Project2.ipynb', 'repo_name': 'shionguha/cosc3570-introdatascience-fa18', 'size': '2999'}