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
import matplotlib.pyplot as plt
# Start coding here!
# read csv file
nobel_data = pd.read_csv("data/nobel.csv")
nobel_data.head()# Question 1: Most commonly awarded gender and birth country
nobel_data['sex'] = nobel_data['sex'].astype(str)
nobel_data['birth_country'] = nobel_data['birth_country'].astype(str)
top_gender = nobel_data['sex'].value_counts().idxmax()
top_country = nobel_data['birth_country'].value_counts().idxmax()
print("Most commonly awarded gender:", top_gender)
print("Most commonly awarded birth country:", top_country)# Question 2: Decade with highest ratio of US-born winners to total winners
nobel_data['decade'] = (nobel_data['year'] // 10) * 10
usa_counts = nobel_data[nobel_data['birth_country'] == 'United States']['decade'].value_counts()
total_counts = nobel_data['decade'].value_counts()
usa_decade_ratio = (usa_counts / total_counts).fillna(0)
max_decade_usa = int(usa_decade_ratio.idxmax())
# Output the result
print("Decade with highest ratio of US-born winners to total winners:", max_decade_usa)# Question 3: Decade and category with highest proportion of female laureates
def female_ratio(group):
return (group['sex'] == 'Female').mean()
female_ratios = nobel_data.groupby(['decade', 'category']).apply(female_ratio)
max_female = female_ratios.idxmax()
max_female_dict = {max_female[0]: max_female[1]}
print("Decade and category with highest proportion of female laureates:", max_female_dict)# Question 4: First woman to receive a Nobel Prize and category
first_woman = nobel_data[nobel_data['sex'] == 'Female'].sort_values(by='year').iloc[0]
first_woman_name = first_woman['full_name']
first_woman_category = first_woman['category']
print("First woman to receive a Nobel Prize:", first_woman_name)
print("Category of first female laureate:", first_woman_category)# Question 5: Individuals or organizations with more than one Nobel Prize
repeat_winners = np.logical_or(nobel_data['full_name'],nobel_data['organization_name']).value_counts()
repeat_list = repeat_winners[repeat_winners > 1].index.tolist()
print("Repeat Nobel Prize winners:", repeat_list)