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 the nobel.csv dataset.
nobel = pd.read_csv("data/nobel.csv")
print(nobel.columns)
print(nobel.head())
Finding the most commonly awarded gender and birth country?
gender = nobel['sex'].value_counts()
top_gender = gender.index[0]
country = nobel['birth_country'].value_counts()
top_country = country.index[0]
print("The gender with the highest number of Nobel Prizes is :", top_gender)
print("The country with the highest number of Nobel Prizes is :", top_country)
Criating a column 'decade' as integer.
nobel['decade'] = (np.floor(nobel['year']/10)*10).astype(int)
print(nobel)
Finding what decade had the highest proportion of US-born winners?
# Creating a dataframe copy US_winners
US_winners = nobel.copy()
# Add a column born_in_USA with true or false to indicate who born in USA
US_winners['born_in_USA'] = US_winners['birth_country'] == 'United States of America'
print(US_winners)
# Calculate the proportion of USA born winners per decade
prop_usa_winners = US_winners.groupby('decade', as_index=False)['born_in_USA'].mean()
print(prop_usa_winners)
# Identify the decade with the highest proportion of US-born winners
max_decade_usa = prop_usa_winners[prop_usa_winners['born_in_USA'] == prop_usa_winners['born_in_USA'].max()]['decade'].values[0]
print("The decade with the highest proportion of US-born winners is :", max_decade_usa)
Finding what decade and category pair had the highest proportion of female laureates?
# Creating a dataframe copy Female_winners
female_winners = nobel.copy()
# Add a column Female_winners with true or false to indicate who is Female
female_winners['Female_winners'] = female_winners['sex'] == 'Female'
print(female_winners)
# Calculate the proportion of Female winners per decade and category
prop_female_winners = female_winners.groupby(['decade','category'], as_index=False)['Female_winners'].mean()
print(prop_female_winners)