Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There is a csv file in '../data/primary-energy-consumption-by-region.csv' that has the energy consumption of different regions of the world from 1965 until 2018 Our world in

There is a csv file in '../data/primary-energy-consumption-by-region.csv' that has the energy consumption of different regions of the world from 1965 until 2018 Our world in Data. We are going to compare the energy consumption of the United States to all of Europe. Load the data into a pandas dataframe. Note: we can get certain rows of the data frame by specifying what we're looking for e.g. EUR = dataframe[dataframe['Entity']=='Europe'] will give us all the rows from Europe's energy consumption.

a. Plot the total energy consumption of the United States and Europe

b. Use a linear least-squares regression to find a function for the energy consumption as a function of year

energy consumed = ()=+f(t)=At+B

c. At what year would you change split the data and use two lines like we did in the land temperature anomoly? Split the data and perform two linear fits.

d. What is your prediction for US energy use in 2025? How about European energy use in 2025?

In Python

energy = pd.read_csv('../data/primary-energy-consumption-by-region.csv') CAN = energy[energy['Entity']=='Canada'] USA = energy[energy['Entity']=='United States'] EUR = energy[energy['Entity']=='Europe'] plt.plot(USA['Year'],USA['Primary Energy Consumption (terawatt-hours)'],'-o') plt.plot(EUR['Year'],EUR['Primary Energy Consumption (terawatt-hours)'],'-s')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

Students also viewed these Databases questions

Question

What are the different techniques used in decision making?

Answered: 1 week ago