sus2018 ProjctPoster Hotfman_Dersey_ Final
How do trust in government and corruption scores
impact a country's happiness score?
CPSC 103 Final Project by Kenzie Hoffman and Mackenzie Dorsey
Overview
+ How happiness of a country is related to their corruption and trust in their government from Kaggle's
World Happiness Report in 2017
+ We both love to travel and wanted see where some countries were placed on this ranking/list and see
how their happiness scores related to other factors
Design Choices
+ We chose to do a bar graph because it relayed information in the most effective visual format
+ Because of the parameters of the bar graph we had to make the Happiness Score in tenths so it would
correlate better with the Trust scores as they range from 0-1
+ We didn't put the country names on the x-axis because depending on the osv test files the country
names would change and wanted the code to be versatile for other programmers.
Problem Solving/Most Challenging
+ initially had our main function return display_bar_chart(readifilename)) but was getting errors because
we needed to create a seperate variable for read{filename) and then have our inputs for
display_bar_chart be our helper functions.
+ we started by inserting print('I got here!) in our code to see where we were having issues and realized it
was related to our main/read functions and their inputs,
nupsiube syzygyclupyteieserfdorey S/ahconverUmLProject/PojetPoser HofTnan_ Dorey Final pyabdowsloadfalse rrsusa018 ProjectPostee Hotfman_Dorsey_ inal
def main(filename: str) -> None:
Reads information from given filename and and displays a bar graph of th
e countries’ happiness scores and
trust in goverment, and returns None
# template based on function composition
data_read_in = read(filename)
all_happiness_scores = get_happiness_score(data_read_in)
all_trust_scores = find trust_score(data_read_in)
return display _bar_chart(all_happiness_scores, ali_trust_scores)
Future Work
+ In the future we could take other factors (ex. Health) of the Happiness Score and compare them to the
score and see how each country differentiates
+ Can see what subcategories of the score make it higher or lower (ex. One country has a high Freedom
number and a low Economy number but has a low happiness score overall, therefore the Economy
affected their ranking)
+ After gathering this info using our programming skills we can make better travelling choices or write a
journalistic piece about the factors that affect a country's happiness and can use our graphs in it!
Inpsiube syzygyclupyteieserdorey S/ahconvervumLProjc/PojetPoser HofTnan_ Dorsey Final pynbdowaload=false