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 Data
df = pd.read_csv('data/nobel.csv')# Data Exploration
df.head(10)df.info()Data Manipulation
top_gender = str(df['sex'].value_counts().nlargest(1).index[0])
top_country = str(df['birth_country'].value_counts().nlargest(1).index[0])
print(top_gender)
print(top_country)count_usa = (df['birth_country'] == 'United States of America').sum()
print(count_usa)# New 'decade' column
df['decade'] = (df['year'] // 10) * 10
# US-born winners
us_winners = df[df['birth_country'] == 'United States of America']
# total winners per decade
total_winners_per_decade = df.groupby('decade').size()
# US-born winners per decade
us_winners_per_decade = us_winners.groupby('decade').size()
# The ratio
ratio = us_winners_per_decade / total_winners_per_decade
# Decade with the highest ratio
max_decade_usa = ratio.idxmax().astype(int)
print(max_decade_usa)df['sex'].value_counts()df['female_winners'] = df['sex'] == 'Female'
print(df.head())# female winners
F_winners = df[df['female_winners'] == True]
# total winners per decade & category
total_winners_per_decade = df.groupby(['decade','category']).size()
# Female winners per decade
female_winners_per_decade = F_winners.groupby(['decade','category']).size()
# The ratio
ratio = female_winners_per_decade / total_winners_per_decade
# Decade with the highest ratio
max_female = ratio.idxmax()
print(max_female)#Highest Proportion of female Lauretes
max_female_dict = {max_female[0]: max_female[1]}
print(max_female_dict)# First woman to receive a Nobel Prize
first_woman_name = F_winners.sort_values('year').iloc[0]['full_name']
#First woman Category
first_woman_category = F_winners.sort_values('year').iloc[0]['category']
print(first_woman_name)
print(first_woman_category)# Repeat Winners
repeat_winners = df['full_name'].value_counts(ascending=False)
repeat_winners = repeat_winners[repeat_winners > 1].index
print(repeat_winners)
repeat_list = repeat_winners.tolist()
print(repeat_list)