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

# Start coding here!
# loading and opening nobel.csv using pandas 
nobel_df =pd.read_csv('data/nobel.csv')
#view the data
print(nobel_df.head())
#checking columns
print(nobel_df.columns)
#checking data information 
print(nobel_df.info())

# What is the most commonly awarded gender and birth country?
top_gender = nobel_df['sex'].value_counts().idxmax()
top_country = nobel_df['birth_country'].value_counts().idxmax()
print(f"top gender: {top_gender}")
print(f"top country: {top_country}")

# Which decade had the highest ratio of US-born Nobel Prize winners to total winners in all categories?

# Create a column by filtering to identify if the winner was born in the United States
nobel_df['if_USA'] = nobel_df['birth_country'] == 'United States of America'

# Create a column to represent the decade of the Nobel Prize
nobel_df['decade'] = (nobel_df['year'] // 10) * 10

# Grouping data by decade to calculate the ratio of US-born winners to total winners for each decade
decade_ratios = nobel_df.groupby('decade')['if_USA'].mean()

# Identify the decade with the highest ratio of US-born nobel prize winners
max_decade_usa = decade_ratios.idxmax()
print(f"max decade usa: {max_decade_usa}")

# Which decade and Nobel Prize category combination had the highest proportion of female laureates?
female_laureates_per_decade = nobel_df[nobel_df['sex'] == 'Female'].groupby(['decade', 'category']).size()
total_laureates_per_decade = nobel_df.groupby(['decade', 'category']).size()

female_ratio_per_decade = female_laureates_per_decade / total_laureates_per_decade

# Find the decade-category combination with the highest proportion of female laureates
max_female_dict = {female_ratio_per_decade.idxmax()[0]: female_ratio_per_decade.idxmax()[1]}

print(f"max female dict: {max_female_dict}")

# Who was the first woman to receive a Nobel Prize, and in what category?
first_woman = nobel_df[nobel_df['sex'] == 'Female'].sort_values('year').iloc[0]
first_woman_name = first_woman['full_name']
first_woman_category = first_woman['category']

print(f"first woman name: {first_woman_name}")
print(f"first woman category: {first_woman_category}")

# Which individuals or organizations have won more than one Nobel Prize throughout the years?
repeat_list = nobel_df['full_name'].value_counts()[nobel_df['full_name'].value_counts() > 1].index.tolist()

print(f"repeat list: {repeat_list}")