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!# Python Code
# Loading in required libraries
library(tidyverse)
library(readr)
library(ggplot2)
# Start coding here!
nbl <- read_csv("data/nobel.csv")
head(nbl)
# Question 1.1 (R-codes)
top_gender_1 <- nbl %>%
group_by(sex) %>%
summarise(total = n()) %>%
arrange(desc(total))
top_gender_1
top_gender <- top_gender_1$sex[1]
top_gender
# Question 1.2 (R-codes)
top_country_1 <- nbl %>%
group_by(birth_country) %>%
summarise(total = n()) %>%
arrange(desc(total))
head(top_country_1,5)
top_country <- top_country_1$birth_country[1]
top_country
# Question 2 (R-codes)
max_decade_usa_1 <- nbl %>%
filter(birth_country == 'United States of America') %>%
mutate(decade = (year %/% 10) * 10) %>%
group_by(decade) %>%
summarise(total = n()) %>%
arrange(desc(total))
head(max_decade_usa_1,5)
max_decade_usa <- max_decade_usa_1$decade[1]
max_decade_usa
# Question 2 (R-codes) Alternative
max_decade_usa_2 <- nbl %>%
mutate(decade = (year %/% 10) * 10) %>%
group_by(decade, birth_country) %>%
summarise(total = n(), .groups = "drop_last") %>% # Ensure grouping is retained for decade
mutate(per = total * 100 / sum(total)) %>% # Calculate percentage within the group
ungroup() %>% # Drop all grouping
select(decade, birth_country, total, per) %>%
arrange(desc(per))
head(max_decade_usa_2)
# Question 3 (R-codes)
max_female_list_1 <- nbl %>%
filter(sex == 'Female') %>%
mutate(decade = (year %/% 10)*10) %>%
group_by(decade, category) %>%
summarise(total = n(), , .groups = "drop_last") %>%
mutate(per = total*100/sum(total)) %>%
arrange(desc(total))
head(max_female_list_1, 5)
max_female_list <- list(2010, 'Peace')
max_female_list
# Question 4 (R-codes)
first_woman_name_1 <- nbl %>%
filter(sex == 'Female') %>%
arrange(year) %>%
select(year, full_name, category)
head(first_woman_name_1,1)
first_woman_name <- first_woman_name_1$full_name[1]
first_woman_name
first_woman_category <- first_woman_name_1$category[1]
first_woman_category
# Question 5
nobel <- nbl %>%
group_by(full_name, organization_name) %>%
summarise(total = n(), .groups = 'drop') %>%
arrange(desc(total))
head(nobel, 5)
repeats <- nobel$full_name[1]
repeats
SELECT *
FROM nbl
LIMIT 5;
-- Question 2 (SQL)
SELECT
FLOOR(year / 10) * 10 AS decade,
birth_country,
COUNT(*) AS total,
COUNT(*)*100/SUM(COUNT(*)) OVER(PARTITION BY FLOOR(year / 10) * 10) AS per
FROM nbl
GROUP BY FLOOR(year/ 10) * 10, birth_country
ORDER BY per DESC
LIMIT 5;