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

# Reading in the Nobel Prize data
nobel = pd.read_csv('data/nobel.csv')

# Store and display the most commonly awarded gender and birth country
top_gender = nobel['sex'].value_counts(sort = True).index[0]
top_country = nobel['birth_country'].value_counts(sort = True).index[0]

print('\nThe gender with the most Nobel laureates is :', top_gender)
print('\nThe most common birth country of Nobel laureates is:', top_country)

# Calculating the proportion of USA born winners per decade
prop_usa_winners = pd.DataFrame()
nobel['usa_born_winner'] = nobel['birth_country'] == "United States of America"
nobel['decade'] = (np.floor(nobel['year'] / 10) * 10).astype(int)
prop_usa_winners = nobel.groupby('decade', as_index = False)['usa_born_winner'].mean()

# Display the proportions of USA born winners per decade
print('\nThe proportions of USA born winners per decade :\n', prop_usa_winners)

# Plot the proportions of USA born winners per decade
ax1 = sns.relplot(data = prop_usa_winners, x = 'decade', y = 'usa_born_winner', kind = 'line')

# Calculating the proportions of female winners by decade and category
prop_female_winners = pd.DataFrame()
nobel['female_winner'] = nobel['sex'] == 'Female'
prop_female_winners= nobel.groupby(['decade', 'category'], as_index = False)['female_winner'].mean()

# Display the proportions of female winners per decade and category
print('\nThe proportions of USA born winners per decade :\n', prop_female_winners)

# Plot the proportions of female winners per decade and category
ax2 = sns.relplot(data = prop_female_winners, x = 'decade', y = 'female_winner', hue = 'category', kind = 'line')

# Finding the first woman to win a Nobel Prize
nobel_women = nobel[nobel['sex'] == 'Female']
min_year = nobel_women['year'].min()
min_row = nobel_women[nobel_women['year'] == min_year]
first_woman_name = min_row['full_name'].values[0]
first_woman_category= min_row['category'].values[0]
print('The first woman to win a Nobel Prize is {} in the category {}.'.format(first_woman_name, first_woman_category))

counts = nobel['full_name'].value_counts()
repeat_list = list(counts[counts > 1].index)