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
# Importing Dataset
nobel = pd.read_csv('data/nobel.csv')
print(df.columns)
# Selecting top value for sex and country
top_gender = nobel['sex'].value_counts().index[0]
top_country = nobel['organization_country'].value_counts().index[0]
# Getting decade of US top winners
nobel['US_born'] = nobel['birth_country'] == 'United States of America'
nobel['decade'] = (np.floor(df['year']/10)*10).astype(int)
usa_born_winner = nobel.groupby('decade', as_index=False)['US_born'].mean()
max_decade_usa = usa_born_winner[usa_born_winner['US_born'] == usa_born_winner['US_born'].max()]['decade'].values[0]
# Relational Plot
plot = sns.relplot(x='decade', y='US_born', data=usa_born_winner, kind="line")
# Finding decade with highest proportion of female winners
nobel['is_female'] = nobel['sex'] == 'Female'
female_winner = df.groupby(['decade', 'category'], as_index=False)['is_female'].mean()
max_female = female_winner[female_winner['is_female'] == female_winner['is_female'].max()][['decade','category']]
max_female_dict = {max_female['decade'].values[0]: max_female['category'].values[0]}
# Relational Plot
plot = sns.relplot(x='decade', y='is_female', data=female_winner, kind="line", hue='category')
# first female winner
female_df = nobel[nobel['is_female']]
df_min = female_df[female_df['year'] == female_df['year'].min()]
first_woman_name = df_min['full_name'].values[0]
first_woman_category = df_min['category'].values[0]
# Determine repeat winners
counts = nobel['full_name'].value_counts()
repeat = counts[counts >= 2].index
repeat_list = list(repeat)