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 pandas as pd
import seaborn as sns
import numpy as np

data = pd.read_csv("data/nobel.csv")
data.info()
data.describe()
# Loading in required libraries
import pandas as pd
import seaborn as sns
import numpy as np

# Start coding here!

# Update the file path to the correct location of the 'nobel.csv' file
data = pd.read_csv("data/nobel.csv")

#Erster Überblick Geschlechter mit Seaborn

sns.countplot(x="sex",data=data)

#Nun in Zahlen:
top_gender=data.value_counts("sex").index[0]
print(top_gender)
# Loading in required libraries
import pandas as pd
import seaborn as sns
import numpy as np

# Start coding here!

# Update the file path to the correct location of the 'nobel.csv' file
data = pd.read_csv("data/nobel.csv")

#Erster Überblick mit count_values
top_country = data.value_counts("birth_country").index[0]
print(top_country)
# Loading in required libraries
import pandas as pd
import seaborn as sns
import numpy as np

# Start coding here!

# Update the file path to the correct location of the 'nobel.csv' file
data = pd.read_csv("data/nobel.csv")

""" Which decade had the highest ratio of US-born Nobel Prize winners to total winners in all categories?
Neue Spalte mit Jahrzehnt und US-Winners"""
data["decade"] = (data["year"] // 10) * 10
data["US_born_winners"] = data["birth_country"] == "United States of America"

# Nach Jahrzehnt und Land filtern
data_srt = data[["decade", "US_born_winners"]]
data_by_decade = data_srt.groupby("decade", as_index=False).mean()

# Find the decade with the highest ratio of US-born winners
max_decade_usa = int(data_by_decade.loc[data_by_decade["US_born_winners"].idxmax()]["decade"])
print(max_decade_usa)

#Line plot
sns.relplot(x="decade",y="US_born_winners",data=data_by_decade,kind="line",ci=None)
# Loading in required libraries
import pandas as pd
import seaborn as sns
import numpy as np

# Start coding here!

# Update the file path to the correct location of the 'nobel.csv' file
data = pd.read_csv("data/nobel.csv")

#Neue Spalte mit Jahrzehnt und US-Winners
data["decade"] = (data["year"] // 10) * 10
data["female_winner"] = data["sex"] == "Female"

#Groupby decade and category
data_srt1 = data.groupby(["decade","category"],as_index=False).mean()
data_female_winner = data_srt1.loc[data_srt1["female_winner"].idxmax()]
max_female_dict = {data_female_winner["decade"]:data_female_winner["category"]}
print(max_female_dict)

#Lineplot
sns.relplot(x="decade",y="female_winner",data=data,kind="line",ci=None,hue="category")

#First woman
only_woman = data[data["female_winner"] == True]
first_woman_name = only_woman.loc[only_woman["year"].idxmin()]["full_name"]
print(first_woman_name)
first_woman_category = only_woman.loc[only_woman["year"].idxmin()]["category"]
print(first_woman_category)
# Loading in required libraries
import pandas as pd
import seaborn as sns
import numpy as np

# Start coding here!

# Update the file path to the correct location of the 'nobel.csv' file
data = pd.read_csv("data/nobel.csv")

#Multiple wins
data_count = data.value_counts("full_name")
two_or_more = data_count[data_count >= 2].index
repeat_list = list(two_or_more)
print(repeat_list)