Overview
You have learned how to use the major building blocks ofprogramming, including variables, if-statements, loops, lists, andnow files. Equipped with these tools, you can use them to solvereal-world problems.
You will write a program to analyze a dataset containinginformation about life expectancies over the years throughout thecountries of the world.
Project Description
The dataset you will be using comesfrom OurWorldInData.org from an article on the SpanishFlu. The first graph on that page shows the life expectancies overthe years for various countries. If you click the "data" tab at thebottom of the graphic, you can download the source data.
You can also download the dataset directlyhere: life-expectancy.csv. This is a .csv (Comma SeparatedValues) file that contains the data you'll need with each columnseparated by commas. There are roughly 19,000 rows in thisdataset.
This dataset is licensed under the Creative Commons BYlicense, you may also read the Life Expectancy DataLicense.
Your task is to write a program to help analyze this largeamount of data.
Assignment
Download the dataset and write a Python program to analyze it toanswer the following questions:
What is the year and country that has the lowest life expectancyin the dataset?
What is the year and country that has the highest lifeexpectancy in the dataset?
Allow the user to type in a year, then, find the average lifeexpectancy for that year. Then find the country with the minimumand the one with the maximum life expectancies for that year.
A sample run could look as follows:
Milestone Requirements
At the end of Lesson 11, to help make sure you are on track tofinish the assignment, you need to complete the following:
Download the dataset
Load the dataset in your Python program
Iterate through the data line by line
Split each line into parts
Find the lowest value for life expectancy and the highest valuefor life expectancy in the dataset. (Note that at this point, youjust need the value for this, not the year and the country for thatvalue.)
Final Requirements
Finish the program by getting the answers to the questions aboveand adding the required functionality.
Showing Creativity and Exceeding Requirements
You can show creativity and exceed the core requirements byadding any kind of data exploration or additional features. Forexample, you could:
Identify the year and country that has the largest drop from oneyear to the next.
Allow the user to type in a country, then show the minimum,maximum, and average life expectancy for that country.
Look for interesting anomalies or patterns in the data.
Find another dataset and work with it.
Anything else you can think of!
Overview You have learned how to use the major building blocks of programming, including variables, if-statements, loops
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am