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

file = 'data/nobel.csv'

nobel = pd.read_csv(file)

nobel.info()
nobel.head(20)
top_gender = nobel['sex'].value_counts().index[0]
top_gender
print("\nThe gender with the most Nobel Prizes is", top_gender)
top_country = nobel['birth_country'].value_counts().index[0]
top_country
print("\n The country with the most Nobel Laureates is",top_country)
# Next question: Which decade had the highest ratio of US-born Nobel Prize winners to total winners in all categories?
# Calculate the proportion of USA born winners.
nobel['usa_born_winners'] = nobel['birth_country'] == 'United States of America'
nobel
# Create a summary of Nobel prizes by decade.

nobel['decade'] = (np.floor(nobel['year']/10)*10).astype(int)
nobel
# Calculate the proportion of USA winners per decade.

prop_usa_winners = nobel.groupby('decade', as_index=False)['usa_born_winners'].mean().round(2)
prop_usa_winners.head()
# Determine the decad with the highest ratio of USA born Nobel Prize winners.

max_decade_usa = prop_usa_winners[prop_usa_winners['usa_born_winners'] == prop_usa_winners['usa_born_winners'].max()]['decade'].values[0]
max_decade_usa
ax1 = sns.relplot(x='decade', y='usa_born_winners',data= prop_usa_winners,kind='line')
# Question number 4 is: Which decade and Nobel Prize category combination had the highest proportion of female laureates?
nobel['female_winners'] = nobel['sex'] == 'Female'
nobel
prop_female_winners = nobel.groupby(['decade','category'],as_index=False)['female_winners'].mean()
prop_female_winners
max_female_decade_category = prop_female_winners[prop_female_winners['female_winners']==prop_female_winners['female_winners'].max()][['decade','category']]

max_female_decade_category
max_female_dict = {max_female_decade_category['decade'].values[0]: max_female_decade_category['category'].values[0]}

max_female_dict