Question
Specifications: Write a Python application that displays the Earth's temperature as related to Carbon emissions. Display the yearly carbon emission and global annual temperature for
Specifications:
Write a Python application that displays the Earth's temperature as related to Carbon emissions.
Display the yearly carbon emission and global annual temperature for the years where the data overlaps.
Output the slope of the Linear Regression line.
Data Files (at the bottom):
Co2.html: Monthly CO2 carbon emissions from 1959 to 2018.
Temperature.html: Annual global Temperatures from 1858 to 2018.
Pre-Processing Data:
The Temperature data is based on monthly values and the CO2 data is annual data.
Refactor the Temperature data into annual values so the Temperature and CO2 can be compared in the same year units.
Average the monthly temperature data into yearly data.
The temperature is expressed in terms of degrees from the average temperature from 1960-1990.
A positive temperature indicates degrees above the average.
A negative temperature indicates degrees below the average.
Storing the Data:
Store the CO2 and Temperature data in separate dictionaries.
Store CO2 and Temperature dictionary in a DataBase container. Use a primitive container like a List, Tuple or Dictionary.
For example: co2 = { key:value, ...
temp = { key:value, ...
database = [ co2, temp ]
Reading the data:
Write a utility class to do file operations like opening a file, reading a file, writing a file, and closing a file.
The read data should be stored in a RAW DATA container, consisting of an [List] of str(strings).
Return the RAW DATA container from the Read function.
Processing the Data:
Use Regular Expressions to parse the RAW input HTML data files.
Dont use HTML parsers, like BeautifulSoup, to parse the data.
Create a class to handle HTML processing using Regular Expressions.
Output:
Process the data to determine the Slope of the Linear Regression line for the data, where the X-axis is the CO2 level and the Temperature, Y-axis, is the dependent variable.
Temperature.html:
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