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) 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) 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
(3) 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:
(4) Calculate the harmonic mean of the total housing units and print it out.
Please answer in details
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
