<jupyter_start><jupyter_text>Top 10 Languages Trends Question N°2What are the trends in top 10 languages popularity over last 11 years?Now we can look at the trends, plotting data about top 5 languages. We can observe that these 10 languages are the most used languages over the 10 years of surveys:1. JavaScript2. PHP3. C4. Java5. C++6. C7. Python8. TypeScript9. Objective-C10. Ruby<jupyter_code>popular_languages = ["JavaScript", "PHP", "C#", "Java", "C++", "C", "Python", "TypeScript", "Objective-C", "Ruby"]<jupyter_output><empty_output><jupyter_text>5. Results AnalysisFor the purposes of this quesion,  previous CRISP-DM stages (Business Understanding, Data Understanding,Data Preparation and Data Modeling) can be reused, hence,I'll proceed with the results' analysis stage, delving into the analysis of results. First question: "What languages were the most popular in each year?"  Plotting the trends in top 10 languages throughout yearsNow I will plot the trend of languages popularity throughout years. Before plotting data, I need to make data ready to be plotted, so I will prepare a Dataframe containing only top 10 languages' by popularity, throughout reference years.<jupyter_code>import pandas as pd

%store -r s_2011_proficiencies
%store -r s_2012_proficiencies
%store -r s_2013_proficiencies
%store -r s_2014_proficiencies
%store -r s_2015_proficiencies
%store -r s_2016_proficiencies
%store -r s_2017_proficiencies
%store -r s_2018_proficiencies
%store -r s_2019_proficiencies
%store -r s_2020_proficiencies
%store -r s_2021_proficiencies

s_surveys_data = {"2011": s_2011_proficiencies, "2012": s_2012_proficiencies, "2013": s_2013_proficiencies,
                  "2014": s_2014_proficiencies, "2015": s_2015_proficiencies, "2016": s_2016_proficiencies,
                  "2017": s_2017_proficiencies, "2018": s_2018_proficiencies, "2019": s_2019_proficiencies,
                  "2020": s_2020_proficiencies, "2021": s_2021_proficiencies}

languages_popularity_df = pd.DataFrame(columns=popular_languages, index=s_surveys_data.keys())


from preparation.data_load import get_10most_popular_languages_by_year

get_10most_popular_languages_by_year(languages_popularity_df, s_surveys_data, popular_languages)<jupyter_output><empty_output><jupyter_text>Now I can plot data, but before that, for readability purposes, I'll set default matplotlib size.<jupyter_code>import matplotlib.pyplot as plt

print("Before, figure default size is: ", plt.rcParams["figure.figsize"])
plt.rcParams["figure.figsize"] = (20, 10)
print("After, figure default size is: ", plt.rcParams["figure.figsize"])


languages_popularity_df.plot.line()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08682634730538923, 'fraction_numerical': 0.06287425149700598, 'mean_word_length': 6.10904255319149, 'pattern_counts': {'":': 11, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '368470', 'license': 'CNRI-Python', 'n_tokens_mistral': 976, 'n_tokens_neox': 829, 'n_words': 263, 'path': 'notebooks/2.Top10LanguagesPopularityTrends.ipynb', 'repo_name': 'alfreedolf/stackoverflow_multiple_years', 'size': '2672'}