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!

import pandas as pd
import seaborn as sns
import numpy as np

file_path = 'data/nobel.csv'

nobel = pd.read_csv(file_path)
nobel.info()
nobel.head()

# Identifing the decade with the highest ratio of US-born winners

top_gender = nobel['sex'].value_counts().index[0]
print(f'\n The most commonly awarded gender of Nobel Prize winners is: {top_gender}.')

top_country = nobel['birth_country'].value_counts().index[0]
print(f'\n The most common birth country of Nobel Prize winners is: {top_country}')

nobel['usa_born_winner'] = nobel['birth_country'] == 'United States of America'
nobel['decade'] = (np.floor(nobel['year'] / 10) * 10).astype(int)

prop_usa_winner = nobel.groupby('decade', as_index= False)['usa_born_winner'].mean()
max_decade_usa = prop_usa_winner[prop_usa_winner['usa_born_winner'] == prop_usa_winner['usa_born_winner'].max()]['decade'].values[0]
print(f"\n The hightest ratio of US-born Nobel Prize winners is in {max_decade_usa}.")

decade_usa_plt = sns.relplot(x = 'decade', y = 'usa_born_winner', data = prop_usa_winner, kind = 'line')


# Finding the decade and category with the highest proportion of female laureates

nobel['female_winner'] = nobel['sex'] == 'Female'

nobel_female_winner_cat = nobel.groupby(['decade', 'category'], as_index = False)['female_winner'].mean()

max_nobel_female_winner_cat = nobel_female_winner_cat[nobel_female_winner_cat['female_winner'] == nobel_female_winner_cat['female_winner'].max()][['decade', 'category']]

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

max_nobel_female_winner_plot = sns.relplot(x = 'decade', y = 'female_winner', hue = 'category', data = nobel_female_winner_cat, kind = 'line')

# finding the first woman to receive a Nobel Prize, and in respective category

nobel_women = nobel[nobel['female_winner']]
min_row = nobel_women[nobel_women['year'] == nobel_women['year'].min()]
first_woman_name = min_row['full_name'].values[0]
first_woman_category = min_row['category'].values[0]

print(f"\n The first women to win a Nobel Prize was {first_woman_name} in {first_woman_category} category.")

# Determining repeat winners

counts = nobel['full_name'].value_counts()
repeats = counts[counts >= 2].index
repeat_list = list(repeats)
print(counts)
print(f"\n The repeated winners are {repeat_list}.")