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 matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np

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

Most Commonly Awarded Gender and their birth country

unique = data.drop_duplicates(subset= ["full_name", "birth_date", "sex"])
gender_counts = data["sex"].value_counts(sort= True) #unique["sex"].value_counts(sort= True)
country_counts = data["birth_country"].value_counts(sort=True) #unique["birth_country"].value_counts(sort=True)
top_gender = str(gender_counts.index[0])
top_country = str(country_counts.index[0])
print(f"Most commonly awarded gender is {top_gender.lower()}.")
print(f"Most commonly awarded birth country is {top_country}.")

Decade with Highest ratio of US born Nobel Prize Winners

data["US_born_winner"] = data["birth_country"] == "United States of America" 
#data["US_born_winner"].head()
data["decade"] = (np.floor(data["year"]/10)*10)
ratio_decade = data.groupby("decade", as_index=False)["US_born_winner"].mean()
highest_row = ratio_decade.loc[ratio_decade["US_born_winner"].idxmax()]
max_decade_usa = int(highest_row["decade"])
print(f"The decade with the highest number of US born Nobel Prize Winners is the {max_decade_usa}s")
sns.relplot(data=ratio_decade,x="decade",y="US_born_winner", kind= "line")

Decade and Nobel Prize category combination with the highest proportion of Female Nobel Prize Winners

data["Female_winners"] = data["sex"] == "Female"
female_winner_ratio = data.groupby(["decade","category"], as_index = False)["Female_winners"].mean()
highest_wins_ratio = female_winner_ratio.loc[female_winner_ratio["Female_winners"].idxmax()]
decade, category = int(highest_wins_ratio["decade"]), str(highest_wins_ratio["category"])
max_female_dict = {decade:category}
print(max_female_dict)
sns.relplot(data=female_winner_ratio,x="decade",y="Female_winners",style="category",hue="category",kind="line")

First woman to recieve a Nobel Prize

female_winner_df = data[data["Female_winners"]]
first_woman = female_winner_df.iloc[0]
first_woman_name, first_woman_category = str(first_woman["full_name"]), str(first_woman["category"])

Repeat Winners of the Nobel Prize

names= data["full_name"].value_counts()
repeat_winners = names[names>1]
repeat_list = list(repeat_winners.index)