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
import statistics
import matplotlib.pyplot as plt# Load the dataset
nobel = pd.read_csv(r'data/nobel.csv')
nobel.head()
EDA
country = nobel[~nobel["birth_country"].isnull()]["birth_country"].unique().tolist()
# United States of America and USA
for i in country:
if i.startswith("U"):
print(i)
print('So we know there are United States of America and USA is the birth_country, we will replace USA with United States of America')nobel['birth_country'] = nobel['birth_country'].replace('USA','United States of America')
country = nobel[~nobel["birth_country"].isnull()]["birth_country"].unique().tolist()
# United States of America and USA
for i in country:
if i.startswith("U"):
print(i)print(nobel['laureate_type'].unique())nobel[nobel['laureate_type'] == 'Organization']nobel.describe()print(f'Nobel Dataset Number of rows: {nobel.shape[0]}')
print(f'Number of unique laureate_id: {nobel["laureate_id"].unique().shape[0]}')dup_id = [i for i in nobel[nobel['laureate_id'].duplicated()]['laureate_id']]
nobel[nobel['laureate_id'].isin(dup_id)].sort_values(by='laureate_id')# What is the most commonly awarded gender and birth country?
top_gender = nobel['sex'].mode()[0]
top_country = nobel['birth_country'].mode()[0]
print(f'the most commonly awarded gender and birth country are: {top_gender} and {top_country}')# Which decade had the highest ratio of US-born Nobel Prize winners to total winners in all categories?
print(f'Number of unique categories: {nobel["category"].unique().shape[0]}')
print(f'Unique categories: {nobel["category"].unique()}')
print(f'Year ranging from {nobel["year"].min()} to {nobel["year"].max()}')# mapping decade to year
decade = []
year = []
for d in np.arange(1900,2030,10).tolist():
for i in range(0,10):
decade.append(d)
year.append(d+i)
left_df = pd.DataFrame({'year':year,'decade':decade})
left_dfnobel_decade = nobel.merge(left_df, how='left', on='year')
usa_winners = nobel_decade[nobel_decade['birth_country'] == 'United States of America'][['decade','laureate_id']].groupby('decade').count()
usa_winners.rename(columns={'laureate_id':'usa_winners'},inplace=True)
print(usa_winners)