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!

Import pertinent libraries for the project.

import pandas as pd
import seaborn as sns
import numpy as np

What is the most commonly awarded gender and birth country?

For this I subset the dataframe grouping data by gender and then by country. For each one value_counts() takes effect and with idxmax() the index is returned

df = pd.read_csv("data/nobel.csv") #Load data
print(df.columns) #See column names

top_gender = df['sex'].value_counts().idxmax()
print("The most awarded gender is: " + str(top_gender))

top_country = df['birth_country'].value_counts().idxmax()
print("The most awarded birth country is: " + str(top_country))
top_country

Which decade had the highest ratio of US-born Nobel Prize winners to total winners in all categories?

First I did a floor division by 10 to the year column, then created the decade column

Define 'usa_born' column being its value True if 'birth_country' is United States Calculated the ratios, grouping by the 'decade' column. Calculated with '.agg()' the variables of total winners and usa winners with pandas.NamedAgg.

Finally divided the number of usa winners by the total winners and got the index from the highest ratio.

df['decade']=(df['year']//10)*10

df['usa_born'] = df['birth_country']=='United States of America'

ratios = df.groupby('decade').agg(
    total_winners=pd.NamedAgg(column='year', aggfunc='count'),
    usa_winners=pd.NamedAgg(column='usa_born', aggfunc='sum')
)
ratios['usa_winner_ratio'] = ratios['usa_winners'] / ratios['total_winners']

max_decade_usa = ratios['usa_winner_ratio'].idxmax()
print(max_decade_usa)

Which decade and Nobel Prize category combination had the highest proportion of female laureates?

For this first create a 'female' column to filter out non female winners.

Then groupby by 'decade' and 'category' which are the columns of interest, filter by 'female' and extract the mean value.

Filter the new subset by setting equality on 'female' to the maximum value in decade and category.

Finally created the dictionary with decade in key and category in value.

df['female'] = df['sex']== 'Female'
female_decade=df.groupby(['decade','category'],as_index=False)['female'].mean()
                                      
max_decade_female= female_decade[female_decade['female']==female_decade['female'].max()][['decade','category']]

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

print(max_female_dict)

Who was the first woman to receive a Nobel Prize, and in what category?

First filter the original dataframe for 'female'

Find the first woman by filtering the last subset setting equality to f_woman['year'].min to find the minimum year.

Finally just extract the full name and category of the last subset with '.values[0]'

f_woman = df[df['female']]
first_woman = f_woman[f_woman['year']== f_woman['year'].min()]
first_woman_name = first_woman['full_name'].values[0]
first_woman_category = first_woman['category'].values[0]                 

print(f" The first woman to win a Nobel Prize was {first_woman_name}, in the category of {first_woman_category}.")

Which individuals or organizations have won more than one Nobel Prize throughout the years?

For this task simply I counted the values for 'full name' coolumn and the filter it by greater or equal to 2 and return the index, this way the full name list is returned.

Finally asign the values to a list and print.

group=df['full_name'].value_counts()
subset = group[group>=2].index
repeat_list=list(subset)
print(repeat_list)