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
# Start coding here!# Load the dataset
nobel_df = pd.read_csv('data/nobel.csv')
# Display the first few rows of the dataframe
nobel_df.head()top_gender = nobel_df['sex'].mode()[0]
top_gendertop_country=nobel_df['birth_country'].mode()[0]
top_countrynobel_df.columns# Extract US-born Nobel Prize winners
us_nobel_winners = nobel_df[nobel_df['birth_country'] == 'United States of America']
# Display the first few rows of the dataframe
us_nobel_winners.head()us_nobel_winners['decade']=np.floor(us_nobel_winners['year']/10)
us_nobel_winners.head()# Ensure 'decade' column exists by creating it from the 'year' column
us_nobel_winners['decade'] = (us_nobel_winners['year'] // 10) * 10
nobel_df['decade'] = (nobel_df['year'] // 10) * 10
# Calculate the total number of US-born winners per decade
us_winners_per_decade = us_nobel_winners.groupby('decade').size()
us_winners_per_decade
# Calculate the total number of winners per decade
total_winners_per_decade = nobel_df.groupby('decade').size()
# Calculate the ratio of US-born winners to total winners per decade
us_winners_ratio = us_winners_per_decade / total_winners_per_decade
# Identify the decade with the highest ratio of US-born winners
highest_ratio_decade = us_winners_ratio.idxmax()
# Store the decade with the highest ratio as an integer
max_decade_usa = int(highest_ratio_decade)
max_decade_usa# Calculate the total number of female laureates per decade and category
female_winners = nobel_df[nobel_df['sex'] == 'Female']
female_winners_per_decade_category = female_winners.groupby(['decade', 'category']).size()
# Calculate the total number of laureates per decade and category
total_winners_per_decade_category = nobel_df.groupby(['decade', 'category']).size()
# Calculate the proportion of female laureates per decade and category
female_winners_ratio = female_winners_per_decade_category / total_winners_per_decade_category
# Identify the decade and category combination with the highest proportion of female laureates
max_female_combination = female_winners_ratio.idxmax()
print(max_female_combination)
# Store the result as a dictionary
max_female_dict = {int(max_female_combination[0]): max_female_combination[1]}female_winners = nobel_df[nobel_df['sex'] == 'Female']
min_row = female_winners[female_winners['year'] == female_winners['year'].min()]
first_woman_name = min_row.iloc[0]['full_name']
first_woman_category = min_row.iloc[0]['category']# Identify organizations that have won more than one Nobel Prize
repeat_orgs = nobel_df[nobel_df['laureate_type'] == 'Organization']['full_name'].value_counts()
repeat_list = repeat_orgs[repeat_orgs > 1].index.tolist()
repeat_listrepeat_winners = nobel_df['full_name'].value_counts()
repeat_list = repeat_winners[repeat_winners > 1].index.tolist()