Skip to content
New Workbook
Sign up
Project: Visualizing the History of Nobel Prize Winners

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

# Load Dataset
nobel = pd.read_csv('data/nobel.csv')
print(nobel.head())
print(nobel.columns)

# Identify the gender with the most Nobel laureates
top_gender = nobel['sex'].value_counts().index[0]
print('The gender with the most Nobel laureates is:', top_gender)

# Identify the country with the most Nobel laureates
top_country = nobel['birth_country'].value_counts().index[0]
print('The country with the most Nobel laureates is:', top_country)

# Identify the decade with the highest proportion of US-born winners
nobel['USA'] = nobel['birth_country'] == 'United States of America'
print(nobel.head())

nobel['decade'] = np.floor(nobel['year'] / 10) * 10
nobel['decade'] = nobel['decade'].astype(int)

# Calculate the mean proportion of US-born winners by decade
mean_decade_usa = nobel.groupby('decade', as_index=False)['USA'].mean()
max_decade_usa = mean_decade_usa[mean_decade_usa['USA'] == mean_decade_usa['USA'].max()]['decade'].values[0]
print('The decade with the highest proportion of laureates from the USA is:', max_decade_usa)

# Plot the proportion of US-born winners by decade
sns.relplot(data=mean_decade_usa, x='decade', y='USA', kind='line')
plt.show()

# Identify the decade and category with the highest proportion of female laureates
nobel['Female'] = nobel['sex'] == 'Female'
print(nobel.head())

max_female = nobel.groupby(['decade', 'category'], as_index=False)['Female'].mean()
print(max_female)

# Find the decade and category with the highest proportion of female laureates
max_female_decade_category = max_female[max_female['Female'] == max_female['Female'].max()][['decade', 'category']]

max_female_dict = {max_female_decade_category['decade'].values[0]: max_female_decade_category['category'].values[0]}
print(max_female_dict)

# Plot the proportion of female winners by decade and category
sns.relplot(x='decade', y='Female', hue='category', data=max_female, kind='line')
plt.show()

# Find the first woman to receive a Nobel Prize
female_only = nobel[nobel['Female']]
print(female_only)

min_row = female_only[female_only['year'] == female_only['year'].min()]
first_woman_name = min_row['full_name'].values[0]
print('The name of the first female laureate is', first_woman_name)

first_woman_category = min_row['category'].values[0]
print('The category of the first female laureate is', first_woman_category)

# Find the winners who have received multiple Nobel Prizes
count = nobel['full_name'].value_counts()
print(count)
repeats = count[count >= 2].index
repeat_list = list(repeats)
print('Winners of multiple Nobel Prizes are:', repeat_list)