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!
    print("hellow")
    Nobel = pd.read_csv('data/nobel.csv')
    Nobel.head(10)
    print(Nobel.describe(include='all'))
    # Display information about the dataset
    print(Nobel.info())
    # Find the most commonly awarded gender
    top_gender = Nobel['sex'].value_counts().idxmax()
    
    # Find the most commonly awarded birth country
    top_country = Nobel['birth_country'].value_counts().idxmax()
    
    # Print the results
    print(top_gender)
    print(top_country)
    # Extract the decade from the year
    Nobel['decade'] = (Nobel['year'] // 10) * 10
    
    # Filter for US-born winners
    us_winners = Nobel[Nobel['birth_country'] == 'United States of America']
    
    # Group by decade and count the number of winners
    decade_counts = Nobel.groupby('decade').size()
    us_decade_counts = us_winners.groupby('decade').size()
    
    # Calculate the ratio of US-born winners to total winners for each decade
    ratios = us_decade_counts / decade_counts
    
    # Find the decade with the highest ratio
    max_decade_usa = ratios.idxmax()
    
    # Print the result
    print(max_decade_usa)
    Nobel['decade'] = (Nobel['year'] // 10) * 10
    
    # Filter for female laureates
    female_nobel = Nobel[Nobel['sex'] == 'Female']
    
    # Group by decade and category, then count the number of female laureates
    female_counts = female_nobel.groupby(['decade', 'category']).size()
    
    # Group by decade and category, then count the total number of laureates
    total_counts = Nobel.groupby(['decade', 'category']).size()
    
    # Calculate the proportion of female laureates for each group
    female_proportions = female_counts / total_counts
    
    # Find the decade and category with the highest proportion of female laureates
    max_female = female_proportions.idxmax()
    
    # Store the result in a dictionary
    max_female_dict = {max_female[0]: max_female[1]}
    
    # Print the result
    print(max_female_dict)
    # Filter for female laureates
    female_nobel = Nobel[Nobel['sex'] == 'Female']
    
    # Sort by year to find the earliest female laureate
    first_female_nobel = female_nobel.sort_values(by='year').iloc[0]
    
    # Extract the name and category of the first female laureate
    first_woman_name = first_female_nobel['full_name']
    first_woman_category = first_female_nobel['category']
    
    # Print the results
    print(first_woman_name)
    print(first_woman_category)
    
    
    # Group by full_name and count the occurrences
    name_counts = Nobel['full_name'].value_counts()
    
    # Filter for names with more than one Nobel Prize
    repeat_names = name_counts[name_counts > 1].index
    
    # Convert to a list
    repeat_list = list(repeat_names)
    
    # Print the result
    print(repeat_list)