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 matplotlib.pyplot as plt
# Start coding here!# loading the Csv file and viewing the first 5
df = pd.read_csv('data/nobel.csv')
df.head()df.info()df.shape# Identifying the most commonly awarded gender and converting to string
top_gender = df['sex'].value_counts().idxmax()
top_gender = str(top_gender)
top_gendertop_country = df['birth_country'].value_counts().idxmax()
top_country = str(top_country)
top_country# Step 1: Create a flag for winners whose birth country is "United States of America"
df["us_winners"] = df['birth_country'] == "United States of America"
df.head(10)# creating decay column to calculate ratio
df['decade'] = (df['year'] // 10) * 10
df.head()decade_ratio = df.groupby('decade', as_index = False)['us_winners'].mean()
decade_ratiomax_ratio_row =decade_ratio[decade_ratio['us_winners'] == decade_ratio['us_winners'].max()]
max_ratio_row# obtaining the ma
max_decade_usa = max_ratio_row['decade'].values[0]
max_decade_usasns.relplot(x='decade', y ='us_winners',data = decade_ratio, kind = 'line')
plt.show()Creating dict for max female winner
# filtering for females
df["female_winner"] = df['sex'] == "Female"
df