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

# Start coding here!
nobel = pd.read_csv('data/nobel.csv')
print(nobel.head())

top_gender = nobel["sex"].value_counts().idxmax()
print(top_gender)

top_country = nobel["birth_country"].value_counts().idxmax()
print(top_country)

nobel["decade"] = (nobel["year"] // 10) * 10

# For the United States of America, filter and find the maximum decade
max_usa = nobel[nobel["birth_country"] == "United States of America"]
max_decade_usa = max_usa["decade"].value_counts().idxmax()
print(max_decade_usa)

# Filter for female laureates
female_nobel = nobel[nobel["sex"] == "Female"]

# Create decade-category combination counts
female_combo_counts = female_nobel.groupby(["decade", "category"]).size()
total_combo_counts = nobel.groupby(["decade", "category"]).size()

# Calculate proportion for each decade-category combination
proportions = female_combo_counts / total_combo_counts

# Sort proportions in descending order and get the highest value's combination
max_combo = proportions.sort_values(ascending=False).index[0]

# Create the dictionary with decade as key and category as value
max_female_dict = {max_combo[0]: max_combo[1]}

# Print the result
print(max_female_dict)

print(nobel.columns)

women_winners = nobel[nobel["sex"] == "Female"]

# Find the earliest year for a woman winner
first_woman_year = women_winners["year"].min()
first_woman = women_winners[women_winners["year"] == first_woman_year]

# Get the name and category as strings
first_woman_name = first_woman["full_name"].values[0]
first_woman_category = first_woman["category"].values[0]

# Print the results
print(first_woman_name)
print(first_woman_category)

# Get counts of individual winners
winner_counts = nobel["full_name"].value_counts()

# Get list of winners with at least 2 prizes
repeat_list = winner_counts[winner_counts >= 2].index.tolist()

print(repeat_list)