Skip to content

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

# Load dataset
nobel_df = pd.read_csv("data/nobel.csv")

# Find most common gender
top_gender = nobel_df["sex"].mode()[0]

# Find most common birth country
top_country = nobel_df["birth_country"].mode()[0]

print(f"Most common gender: {top_gender}")
print(f"Most common birth country: {top_country}")

# Create a flag for US-born winners
nobel_df["us_born"] = nobel_df["birth_country"] == "United States of America"

# Create a decade column
nobel_df["decade"] = (nobel_df["year"] // 10) * 10

# Calculate the ratio of US-born winners to total winners per decade
us_ratio = nobel_df.groupby("decade")["us_born"].mean()

# Identify the decade with the highest ratio
max_decade_usa = us_ratio.idxmax()

print(f"Decade with highest ratio of US-born winners: {max_decade_usa}")

# Filter for female winners
female_winners = nobel_df[nobel_df["sex"] == "Female"]

# Group by decade and category, calculate proportion of female winners
female_ratio = (
    female_winners.groupby(["decade", "category"])
    .size()
    .div(nobel_df.groupby(["decade", "category"]).size())
    .reset_index(name="female_ratio")
)

# Find the decade and category with the highest proportion
max_female_row = female_ratio.loc[female_ratio["female_ratio"].idxmax()]
max_female_dict = {int(max_female_row["decade"]): max_female_row["category"]}

print(f"Decade and category with highest proportion of female winners: {max_female_dict}")

# Filter for female winners and find the first year
first_woman = female_winners.loc[female_winners["year"].idxmin()]
first_woman_name = first_woman["full_name"]
first_woman_category = first_woman["category"]

print(f"First woman to win a Nobel Prize: {first_woman_name} in {first_woman_category}")

# Count the number of times each winner has won
winner_counts = nobel_df["full_name"].value_counts()

# Filter for those who have won more than once
repeat_list = winner_counts[winner_counts > 1].index.tolist()

print(f"Individuals or organizations that have won multiple times: {repeat_list}")