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!
# Load the dataset
df = pd.read_csv('data/nobel.csv')
# Ensure consistent column names (for older formats, may vary slightly)
df.columns = df.columns.str.lower()
# --- 1. Most common gender and birth country ---
top_gender = df['sex'].value_counts().idxmax()
top_country = df['birth_country'].value_counts().idxmax()
# --- 2. Decade with highest ratio of US-born laureates to total laureates ---
# Create a 'decade' column
df['decade'] = (df['year'] // 10) * 10
# Calculate ratio per decade
decade_group = df.groupby('decade')
ratio_usa = decade_group.apply(lambda x: (x['birth_country'] == 'United States of America').sum() / len(x))
max_decade_usa = ratio_usa.idxmax()
# --- 3. Decade/category combo with highest proportion of female laureates ---
female_df = df[df['sex'] == 'Female']
female_group = df.groupby(['decade', 'category'])
female_ratio = female_group['sex'].apply(lambda x: (x == 'Female').sum() / len(x))
# Get the max
max_ratio_idx = female_ratio.idxmax()
max_female_dict = {max_ratio_idx[0]: max_ratio_idx[1]}
# --- 4. First woman to receive a Nobel Prize and the category ---
first_female = df[df['sex'] == 'Female'].sort_values('year').iloc[0]
first_woman_name = first_female['full_name']
first_woman_category = first_female['category']
# --- 5. Individuals or orgs who won more than once ---
repeat_counts = df['full_name'].value_counts()
repeat_list = repeat_counts[repeat_counts > 1].index.tolist()
# --- Output for checking ---
print("top_gender:", top_gender)
print("top_country:", top_country)
print("max_decade_usa:", max_decade_usa)
print("max_female_dict:", max_female_dict)
print("first_woman_name:", first_woman_name)
print("first_woman_category:", first_woman_category)
print("repeat_list:", repeat_list)