Skip to content
Project: Visualizing the History of Nobel Prize Winners
  • AI Chat
  • Code
  • Report
  • The Nobel Prize has been among the most prestigious international awards since 1901. Each year, awards are bestowed in chemistry, literature, physics, physiology or medicine, economics, and peace. In addition to the honor, prestige, and substantial prize money, the recipient also gets a gold medal with an image of Alfred Nobel (1833 - 1896), who established the prize.

    The Nobel Foundation has made a dataset available of all prize winners from the outset of the awards from 1901 to 2023. The dataset used in this project is from the Nobel Prize API and is available in the nobel.csv file in the data folder.

    In this project, you'll get a chance to explore and answer several questions related to this prizewinning data. And we encourage you then to explore further questions that you're interested in!

    # Loading in required libraries
    import pandas as pd
    import seaborn as sns
    import numpy as np
    
    # Start coding here!
    # Update the file path to the correct location of the 'nobel.csv' file
    nobel_prize = pd.read_csv('data/nobel.csv')
    
    top_gender = nobel_prize['sex'].value_counts().index[0]
    top_country = nobel_prize['birth_country'].value_counts().index[0]
    
    nobel_prize['US_winners'] = nobel_prize['birth_country'] == 'United States of America'
    nobel_prize['decade'] = np.floor(nobel_prize['year'] / 10) * 10
    nobel_prize['decade'] = nobel_prize['decade'].astype(int)
    df_new = nobel_prize.groupby('decade', as_index=False)['US_winners'].mean()
    max_decade_usa = df_new[df_new['US_winners'] == df_new['US_winners'].max()]['decade'].values[0]
    
    sns.relplot(x='decade', y='US_winners', data=df_new, kind='line')
    
    nobel_prize['female_winner'] = nobel_prize['sex'] == 'Female'
    df_female = nobel_prize.groupby(['decade', 'category'], as_index=False)['female_winner'].mean()
    max_female_dict = {
        df_female[df_female['female_winner'] == df_female['female_winner'].max()]['decade'].values[0]: df_female[df_female['female_winner'] == df_female['female_winner'].max()]['category'].values[0]
    }
    
    sns.relplot(x='decade', y='female_winner', data=df_female, hue='category', kind='line')
    
    new_df = nobel_prize[nobel_prize['female_winner']]
    min_row = new_df[new_df['year'] == new_df['year'].min()]
    first_woman_name, first_woman_category = min_row['full_name'].values[0], min_row['category'].values[0]
    
    repeat_winners = pd.DataFrame(nobel_prize['full_name'].value_counts())
    repeat_winners.columns = ['count']
    repeat_list = list(repeat_winners[repeat_winners['count'] >= 2].index)