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
# Start coding here!
Nobel_winners_df = pd.read_csv("data/nobel.csv")
print(Nobel_winners_df.columns)
Top gender and top country
top_gender = Nobel_winners_df["sex"].value_counts().idxmax()
print(top_gender)
top_country = Nobel_winners_df["birth_country"].value_counts().idxmax()
print(top_country)
Nobel_winners_df['USA'] = Nobel_winners_df["birth_country"] == "United States of America"
Nobel_winners_df['decade'] = (Nobel_winners_df['year'] // 10) * 10
us_born_winners = Nobel_winners_df[Nobel_winners_df['USA']]
decade_counts = us_born_winners['decade'].value_counts().reset_index()
decade_counts.columns = ['decade', 'count']
max_decade_usa = decade_counts.loc[decade_counts['count'].idxmax(), 'decade']
max_count_usa = decade_counts['count'].max()
plt.figure(figsize=(10, 6))
sns.lineplot(data=decade_counts, x='decade', y='count', marker='o')
plt.title("Number of US-born Nobel Prize Winners per Decade")
plt.xlabel("Decade")
plt.ylabel("Number of US-born Winners")
plt.grid(True)
plt.show()
Nobel_winners_df['isFemale'] = Nobel_winners_df["sex"] == "Female"
women_winners = Nobel_winners_df[Nobel_winners_df['isFemale']]
female_winners_by_decade_category = Nobel_winners_df.groupby(['decade', 'category'], as_index=False)['isFemale'].mean()
female_winners_by_decade_category.rename(columns={'isFemale': 'female_winner_proportion'}, inplace=True)
max_female_winner_row = female_winners_by_decade_category.loc[
female_winners_by_decade_category['female_winner_proportion'].idxmax()
]
decade = max_female_winner_row['decade']
category = max_female_winner_row['category']
max_female_dict = {decade: category}
plt.figure(figsize=(12, 6))
sns.lineplot(
data=female_winners_by_decade_category,
x='decade',
y='female_winner_proportion',
hue='category',
marker='o'
)
plt.title('Proportion of Female Winners by Decade and Category')
plt.xlabel('Decade')
plt.ylabel('Female Winner Proportion')
plt.legend(title='Category')
plt.show()
first_female_winner = women_winners.loc[women_winners['year'].idxmin()]
first_woman_name = first_female_winner['full_name']
first_woman_category = first_female_winner['category']
print("First woman to receive a Nobel Prize:")
print(f"Name: {first_woman_name}, Category: {first_woman_category}")
repeat_winners = Nobel_winners_df['full_name'].value_counts()
repeat_list = repeat_winners[repeat_winners > 1].index.tolist()
print("Individuals or organizations with more than one Nobel Prize:")
print(repeat_list)