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()

top_gender = df['sex'].value_counts().index[0]
top_country = df['birth_country'].value_counts().index[0]
# type(top_country)
# Adding a column to indicate if the laureate was born in the US
df['us_born_winner'] = df['birth_country'] == 'United States of America'
df['decade'] = (df['year'] // 10) * 10

# Grouping by decade and calculating the mean of US-born winners
us_born_ratio_by_decade = df.groupby('decade', as_index=False)['us_born_winner'].mean()

# Finding the decade with the highest ratio of US-born winners
max_decade_usa = us_born_ratio_by_decade.loc[us_born_ratio_by_decade['us_born_winner'].idxmax(), 'decade']
max_decade_usa
df['is_female'] = df['sex'] == 'Female'
# df.head()
cat_decade = df.groupby(by=['decade' , 'category'], as_index=False)['is_female'].mean()
max_female_dict = cat_decade.loc[cat_decade['is_female'].idxmax()]
max_female_dict = {max_female_dict[0]:max_female_dict[1]}
# df.head()
# max_female_dict.index[0]
max_female_dict
fem = df[df['sex'] == 'Female']
year = fem['year'].min()
first_woman = fem[fem['year'] == year]
first_woman_name = first_woman['full_name'].values[0]
# first_woman_name
first_woman_category = first_woman['category'].values[0]
dup = df[df['full_name'].duplicated(keep=False)]
repeat_list = list(dup['full_name'].unique())
repeat_list