icient between two lists. i.Use this function to calculate the correlation coefficient between price and year. In your Solution document, provide the resulting figure rounded (manually or using Python) to two decimal places. Also provide the Python code yo

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

b.The Python file q5.py imports the function corr_coef() which you used in Section 5.4 of Block 2 Part 5 to calculate the correlation coefficient between two lists.

  • i.Use this function to calculate the correlation coefficient between price and year.

    In your Solution document, provide the resulting figure rounded (manually or using Python) to two decimal places. Also provide the Python code you used for calling the corr_coef() function and explain how you executed it

You must give a word count for any question with a maximum word limit.
This question is about Block 2 Part 5. This question requires you to calculate values using
Python functions. There are two approaches you can use.
.
add suitable code to the provided file, then run it.
run the provided file first, to load the required function and data into memory, then do
the calculation in the interactive Python shell.
Feel free to choose the approach you prefer.
The download folder for this TMA contains TM112_22J_TMA02_Q5_files.zip (go to TMA
Python files, download TM112_22J_TMA02_Q5_files.zip and unzip the file). While you are
working on this question, keep all the files in TM112_22J_TMA02_Q5_files together in that
folder. Moving files out of the folder may result in some of the code not working.
Open the folder TM112_22J_TMA02_Q5_files and inspect the contents of q5.py.
The file contains two Python lists, each containing 13 values. These lists contain data about
house prices per metre squared in London, between 2004 and 2016. The annual data on
house price by size of property is calculated using data from HM Land Registry and Valuation
Office Agency.
The list year is a list of the years and the list price contains the corresponding average
house price per metre squared for each of these years.
Both data sets are from the Office for National Statistics (Office for National Statistics, 2017).
The following statistics show that the price of houses generally increases every year. For
example, the price per area in London in 2016 was 198% (nearly double) that of 2004.
7000
6000
5000
4000
3000
2000
1000
0
2004 2005 2006
2008 2009 2010 2011 201 2013 2014 2015 2016
Figure 1 House prices based on size House Price per area (metre squared) in London, 2004
to 2016 (house and flat)
Transcribed Image Text:You must give a word count for any question with a maximum word limit. This question is about Block 2 Part 5. This question requires you to calculate values using Python functions. There are two approaches you can use. . add suitable code to the provided file, then run it. run the provided file first, to load the required function and data into memory, then do the calculation in the interactive Python shell. Feel free to choose the approach you prefer. The download folder for this TMA contains TM112_22J_TMA02_Q5_files.zip (go to TMA Python files, download TM112_22J_TMA02_Q5_files.zip and unzip the file). While you are working on this question, keep all the files in TM112_22J_TMA02_Q5_files together in that folder. Moving files out of the folder may result in some of the code not working. Open the folder TM112_22J_TMA02_Q5_files and inspect the contents of q5.py. The file contains two Python lists, each containing 13 values. These lists contain data about house prices per metre squared in London, between 2004 and 2016. The annual data on house price by size of property is calculated using data from HM Land Registry and Valuation Office Agency. The list year is a list of the years and the list price contains the corresponding average house price per metre squared for each of these years. Both data sets are from the Office for National Statistics (Office for National Statistics, 2017). The following statistics show that the price of houses generally increases every year. For example, the price per area in London in 2016 was 198% (nearly double) that of 2004. 7000 6000 5000 4000 3000 2000 1000 0 2004 2005 2006 2008 2009 2010 2011 201 2013 2014 2015 2016 Figure 1 House prices based on size House Price per area (metre squared) in London, 2004 to 2016 (house and flat)
File Edit Format Run Options Window Help
TM112 22J TMA02 Q5
11 11 11
11 11 11
from tma02_stats import median
from tma02_stats import mean
from tma02_stats import corr_coef
# House Price per area (metre squared), 2004 to 2016 in London (house and flat)
# Source: UK House Price Index, HM Land Registry, Valuation Office Agency
# List year with 13 values.
year= [2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011, 2012, 2013, 2014, 2015, 2016]
# List price with 13 values
price
= [3359.839973, 3478.218393, 3711.40699, 4214.20556, 4228.791063,
3867.851602, 4327.927257, 4391.45437, 4546.196727,
4896.303054, 5627.113754, 5936.608344, 6639.413952]
11 11 11 You
can use one of two approaches:
2)
1) add suitable code below and then run this file
run this file first then do the calculation in the
Python interactive shell.
Transcribed Image Text:File Edit Format Run Options Window Help TM112 22J TMA02 Q5 11 11 11 11 11 11 from tma02_stats import median from tma02_stats import mean from tma02_stats import corr_coef # House Price per area (metre squared), 2004 to 2016 in London (house and flat) # Source: UK House Price Index, HM Land Registry, Valuation Office Agency # List year with 13 values. year= [2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016] # List price with 13 values price = [3359.839973, 3478.218393, 3711.40699, 4214.20556, 4228.791063, 3867.851602, 4327.927257, 4391.45437, 4546.196727, 4896.303054, 5627.113754, 5936.608344, 6639.413952] 11 11 11 You can use one of two approaches: 2) 1) add suitable code below and then run this file run this file first then do the calculation in the Python interactive shell.
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Procedures in SQL
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education