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 matplotlib.pyplot as plt
import numpy as np
# Load the nobel.csv into a pandas DataFrame
df_nobel = pd.read_csv('data/nobel.csv')
# Most commonly awarded gender and birth country
top_gender = df_nobel["sex"].mode().values[0]
top_country = df_nobel['birth_country'].mode().values[0]
# Decade with the highest ratio of US-born Nobel Price winners
df_nobel["decade"] = np.floor(df_nobel["year"]/10)*10
df_nobel["us-born_winners"] = df_nobel["birth_country"]=='United States of America'
ratio = df_nobel.groupby("decade", as_index=False)["us-born_winners"].mean()
max_decade_usa = int(ratio.loc[ratio["us-born_winners"].idxmax(), 'decade'])
# Relational line plot of decade vs ratio of US-born Nobel Price winners
sns.relplot(x='decade', y='us-born_winners', data=ratio, kind="line")
plt.xlabel("Decade")
plt.ylabel("Ratio")
plt.title("Ratio of US-born Nobel Price Winners")
plt.show()
# Decade with highest proportion of female laureates
df_nobel["female_winner"] = df_nobel["sex"] == "Female"
df_grouped = df_nobel.groupby(["decade","category"], as_index=False)["female_winner"].mean()
max_row = df_grouped[df_grouped["female_winner"]==df_grouped["female_winner"].max()]
max_decade =int(max_row["decade"].values[0])
max_category = max_row["category"].values[0]
max_female_dict= {max_decade:max_category}
# Relational line plot of decade vs proportion of female laureates
sns.relplot(x='decade', y='female_winner', hue = 'category', data=df_grouped, kind="line")
plt.xlabel("Decade")
plt.ylabel("Proportion")
plt.title("Proportion of Female Laureates Per Category")
plt.show()
# The first woman who won a Nobel Price
df_female_winners = df_nobel[df_nobel['sex']=="Female"]
min_row = df_female_winners[df_female_winners["year"]==df_female_winners["year"].min()]
first_woman_name = min_row["full_name"].values[0]
first_woman_category = min_row["category"].values[0]
# Individuals or Organizations who have won Nobel Price more than one
repeat_winners = df_nobel["full_name"].value_counts()
repeat_winners_subset = repeat_winners[repeat_winners >= 2].index
repeat_list = list(repeat_winners_subset)