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=pd.read_csv('data/nobel.csv')
nobel.head
#nobel.info()
nobel.columns
#1
top_gender=nobel[['sex']].value_counts().index[0]
top_gender=str(top_gender[0])
top_country=nobel[['birth_country']].value_counts().index[0]
top_country=str(top_country[0])
print("\n The gender with the most Nobel laureates is :", top_gender)
print(" The most common birth country of Nobel laureates is :", top_country)
#2
nobel['decade']=(nobel['year']//10)*10
# Filtrar solo ganadores nacidos en EE.UU.
usa_winners=nobel[nobel['birth_country'] =='United States of America']
# Calcular el total de ganadores por década y los ganadores nacidos en EE.UU. por década
total_winners_by_decade = nobel.groupby('decade').size()
total_winners_by_decade_usa=usa_winners.groupby('decade').size()
#usa_winners_by_decade = usa_winners.groupby('decade').size()
max_decade_usa=total_winners_by_decade_usa.sort_values(ascending=False).index[0]
max_decade_usa
#3 Decadekey
nobel['decade'] = (nobel['year'] // 10) * 10
nobel['female_winner'] = nobel['sex'] == 'Female'
fem_win = nobel.groupby(['decade', 'category'], as_index=False)['female_winner'].mean()
max_female_decade_category = fem_win[fem_win['female_winner'] == fem_win['female_winner'].max()][['decade', 'category']]
max_female_dict={max_female_decade_category['decade'].values[0]:max_female_decade_category['category'].values[0]}
max_female_dict
nb=nobel[nobel['female_winner']]
nb
#4 Save your string answers as first_woman_name and first_woman_category.
mr=nb[nb['year'] == nb['year'].min()]
first_woman_name=mr['full_name'].tolist()[0]
first_woman_category=nb['category'].tolist()[0]
print('The first woman who was prized was : '+first_woman_name+ " in "+first_woman_category+ " category")
nd=nobel[['full_name', 'organization_name']]
name=nd['full_name'].value_counts()
ct=name[name>=2].index
repeat_list=list(ct)
repeat_list