Question
In the field of Data Science, data is often formatted as a comma-delimited (CSV) file, where each line in a file corresponds to a field's
In the field of Data Science, data is often formatted as a comma-delimited (CSV) file, where each line in a file corresponds to a field's value. Refer to Chapter 9 (p. 106) for more information on comma-delimited files. To answer this question, you will need to download the file Assignment1_denton_housing.csv included with this assignment. The file Assignment1_denton_housing.csv contains statistics about housing in the city of Denton from 2008 to 2014. Write a program to implement the following questions.
(1) (10 pts) Calculate the difference in the number of Occupied Housing Units from year to year and print it. The difference must be calculated for the consecutive years such as 2008-2009, 2009-2010 etc. Finally, print the values in the ascending order.
(2) (10 pts) For all the years, calculate the percentage of housing units which are vacant an occupied. Print the results in the following format:
Year Vacant Housing Units Occupied Housing Units
2008 30% 70% 2009 ----- ----- 2010 ----- ----- 2011 ----- ----- 2012 ----- ----- 2013 ----- ----- 2014 ----- -----
(3) (10 pts) Calculate and print the valued and years in which the highest number of housing units were vacant and occupied. Print the results in the following format:
Year Value Vacant Housing Units ----- ----- Occupied Housing Units ----- -----
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started