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

# Start coding here!
nobel_csv = pd.read_csv("data/nobel.csv")
nobel_csv
nobel_csv.shape
top_sex = nobel_csv['sex'].value_counts()
# top_sex
top_gender = top_sex.index[0]
top_gender
countries = nobel_csv['birth_country'].value_counts()
top_country = countries.index[0]
top_country
nobel_csv['US_born_winners'] = nobel_csv['birth_country'] == 'United States of America'
nobel_csv['decade'] = (np.floor(nobel_csv['year']/10) * 10).astype(int)
nobel_csv.shape
nobel_csv
max_decade_usa_df = nobel_csv.groupby('decade', as_index=False).agg({'US_born_winners': 'mean'})
# max_decade_usa_df['US_born_winners'].max()
max_decade_usa_df
# max_decade_usa_df.index[1]
max_decade_usa = max_decade_usa_df[max_decade_usa_df['US_born_winners'] == max_decade_usa_df['US_born_winners'].max()]['decade'].iloc[0]
max_decade_usa
sns.relplot(kind="line", data=nobel_csv, x='decade', y='US_born_winners')
# nobel_csv_female = nobel_csv[nobel_csv['sex'] == 'Female']
# nobel_csv_female
nobel_csv['female_winners'] = nobel_csv['sex'] == 'Female'
nobel_csv
max_female = nobel_csv.groupby(['decade','category'], as_index=False).agg({'female_winners':'mean'})
max_female
max_female_de_cat = max_female[max_female['female_winners'] == max_female['female_winners'].max()][['decade', 'category']]
max_female_de_cat
max_female_dict = {max_female_de_cat['decade'].values[0] : max_female_de_cat['category'].values[0]}
max_female_dict
nobel_csv_female_winners = nobel_csv[nobel_csv['female_winners']]
nobel_csv_female_winners
first_woman_name = nobel_csv_female_winners.iloc[0]['full_name']
first_woman_name
first_woman_category = nobel_csv_female_winners.iloc[0]['category']
first_woman_category