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
import matplotlib.pyplot as plt
# Loading the dataset
nobel =pd.read_csv(r"data/nobel.csv")
nobel.head()
nobel.info()
# Checking the total number of rows and colums
nobel.shape
# Visualizing the sex distribution 
sns.countplot(x="sex", data=nobel)
plt.show()
top_gender = "Male"
# Checking the number of unique birth countries
nobel["birth_country"].value_counts()
top_country="United States of America"
# Checking the year format
nobel.head()
# Creating a column for US borns
nobel["US_born"] = nobel["birth_country"] == "United States of America"
# Creating a column to get the decade where the last digit has to be zero, 0
nobel["decade"] = (np.floor(nobel["year"]/10)*10).astype(int)
# Creating a df of decade and US born ratio
decade_usa = nobel.groupby("decade", as_index=False)["US_born"].mean()
# Visualizing the decade_usa using a barplot
sns.catplot(x="decade", y="US_born", data=decade_usa, kind="bar")
plt.show()
# Providing the answer for project auto-marking
max_decade_usa = 2000