<jupyter_start><jupyter_text>A question that many want to know, is whether their country is the best in terms of winning Olympic medals. The research question that I have decided to explore and analyze is:**Research Question****Which Country has been awarded the most medals?**<jupyter_code>data = load_and_process("../data/raw/Summer-Olympic-medals-1976-to-2008 2.csv")
data.head()<jupyter_output><empty_output><jupyter_text>**Columns Removed**The three main columns that will be explored are 'Country' 'Year' and 'Medal'. In order to focus on the selected columns, I must remove the others<jupyter_code>rem_columns(data)<jupyter_output><empty_output><jupyter_text>**Profile Report**After generating a report, we are able to clearly see that the United States is the country with the most medals awarded. We can generate a basic visualization to see the top ten medal winning countries.<jupyter_code>rem_columns(data).profile_report()<jupyter_output><empty_output><jupyter_text>**Visualization 1**<jupyter_code>total_rem = rem_columns(data)
total_final = country_medal(total_rem)

countries = sns.countplot(data = rem_columns(data), palette = "colorblind", order = total_final[0:5]['Country'].value_counts().index, y = "Country")
countries.set_title('Top 5 Medal Winning Countries')<jupyter_output><empty_output><jupyter_text>**Visualization 2**Now that we can visually see that the U.S is the top medal winner, I will graph the type of medals earned by each country. We can in fact see that the U.S not only has earned the most medals, but they have earned the most gold/siver/bronze medals compared to the other top 5 countries<jupyter_code>countries_2 = sns.countplot(data = rem_columns(data), palette = "colorblind", hue = "Medal", order = total_final[0:5]['Country'].value_counts().index,
                   y = "Country")
countries_2.set_title('Top 5 Medal Winning Countries')<jupyter_output><empty_output><jupyter_text>**Visualization 3**Simple closer look at the U.S medals<jupyter_code>us_country = sns.countplot(data = rem_columns(data), palette = "colorblind", hue = "Medal",order = total_final[0:1]['Country'].value_counts().index,
                           x = "Country")<jupyter_output><empty_output><jupyter_text>**Visualization 4**Finally we can look at the amount of medals earned by the U.S yearly. The graph below helps indicate that the majority of medals were won between 1980-1990. We will explore this further in task 5.<jupyter_code>total_final2 = country_medal_year(total_rem)

us_line = total_final2.query("Country == 'United States'")
us_time = sns.lineplot(data = us_line, palette = "colorblind", x = "Year", y = "Count", hue = "Country")
us_time.set_title('U.S Medals Won between 1976-2008')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10646802325581395, 'fraction_numerical': 0.015625, 'mean_word_length': 6.113695090439276, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '144161', 'license': 'MIT', 'n_tokens_mistral': 891, 'n_tokens_neox': 828, 'n_words': 266, 'path': 'analysis/Segundo2/Milestone2_T4.ipynb', 'repo_name': 'data301-2020-winter2/course-project-group_1053', 'size': '2752'}