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!
df = pd.read_csv('data/nobel.csv')
df.head()
# How many rows and columns are in the DataFrame
df.shape

1. What is the most commonly awarded gender and birth country?

def df_count(df, col):
    """
    Counts how many counts of a variable is in the column.
    """
    return df[col].value_counts()
# Finding the values
df_count(df,'sex')
df_count(df,'birth_country')
# Answer
top_gender='Male'
top_country='United States of America'

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

#Making column of winners from the US
df['us_winners'] = df['birth_country'] == 'United States of America'
df.head()
#Making a column of decades
df['decade'] = (df['year'] // 10) * 10
df.head()
# Finding the ratio of US born winners and total winners across decades
df_with_ratio = df.groupby('decade').agg(us_winners_ratio=('us_winners', 'mean')).reset_index()

df_with_ratio
# Finding the decade with the highest ratio
max_decade_usa = df_with_ratio.loc[df_with_ratio['us_winners_ratio'].idxmax(), 'decade']

max_decade_usa

3. Which decade and Nobel Prize category combination had the highest proportion of female laureates?

#Filter female winners
df['female_winners'] = df['sex'] == 'Female'
df.head()