SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
12/21/2020 Energy_DS - Jupyter Notebook
localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 1/9
Energy Production Analysis in the USA
In this notebook we will be analyzing growth rates of energy production
in the US. We will most likely want to compare Total Fossil Fuel
Production with the Total Renewable Energy Production, to understand
how the production as increased or decreased over the years.
Additionally, we will calculate growth rate for both.
Data is from 1949-2019. Note: Solar Energy Production started 1984
In [1]:
In [2]:
In [3]:
Out[3]:
Annual
Total
Coal
Production
Natural
Gas (Dry)
Production
Crude Oil
Production
Natural
Gas Plant
Liquids
Production
Total
Fossil
Fuels
Production
Nuclear
Electric
Power
Production
Hydroelectric
Power
Production
G
P
0 1949 11.973882 5.377243 10.683252 0.706102 28.740479 0.0 1.424722
1 1950 14.060135 6.232975 11.446729 0.813366 32.553205 0.0 1.415411
2 1951 14.419325 7.415733 13.036724 0.910336 35.782118 0.0 1.423795
3 1952 12.734313 7.963599 13.281049 0.985701 34.964662 0.0 1.465812
4 1953 12.277746 8.338838 13.671076 1.050702 35.338361 0.0 1.412859
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
xls = pd.ExcelFile('Energy_Production_by_Source.xlsx')
df1 = pd.read_excel(xls, 'Annual Data')
df2 = pd.read_excel(xls, 'Monthly Data')
df1.head()
12/21/2020 Energy_DS - Jupyter Notebook
localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 2/9
In [4]:
In [5]:
Graph Total Fossil Fuels Production since 1984 - 2019
Out[4]:
Annual
Total
Coal
Production
Natural
Gas (Dry)
Production
Crude Oil
Production
Natural
Gas Plant
Liquids
Production
Total
Fossil
Fuels
Production
Nuclear
Electric
Power
Production
Hydroelectric
Power
Production
51 2000 22.735478 19.661529 12.358101 2.551466 57.306574 7.862349 2.811116
52 2001 23.547080 20.165567 12.281566 2.490533 58.484745 8.028853 2.241858
53 2002 22.732237 19.382055 12.160213 2.502206 56.776711 8.145429 2.689017
54 2003 22.093652 19.633304 11.959568 2.296059 55.982583 7.959622 2.792539
55 2004 22.852099 19.074254 11.550086 2.407581 55.884020 8.222774 2.688468
56 2005 23.185189 18.556015 10.974152 2.279946 54.995301 8.160810 2.702942
57 2006 23.789510 19.021706 10.766775 2.298717 55.876707 8.214626 2.869035
58 2007 23.492742 19.786209 10.741447 2.348716 56.369113 8.458589 2.446389
59 2008 23.851368 20.702884 10.613302 2.359299 57.526852 8.426491 2.511108
60 2009 21.623721 21.139450 11.340126 2.508252 56.611549 8.355220 2.668824
61 2010 22.038226 21.805763 11.610472 2.704829 58.159290 8.434433 2.538541
62 2011 22.221407 23.405720 11.997530 2.890075 60.514732 8.268698 3.102852
63 2012 20.676893 24.610065 13.841900 3.162126 62.290983 8.061822 2.628702
64 2013 20.001304 24.859072 15.865054 3.451386 64.176816 8.244433 2.562382
65 2014 20.285705 26.718073 18.607136 4.005085 69.615999 8.337559 2.466577
66 2015 17.946095 28.066882 19.712044 4.475993 70.201013 8.336886 2.321177
67 2016 14.667089 27.576023 18.537316 4.664785 65.445213 8.426753 2.472442
68 2017 15.625377 28.289335 19.575779 4.987096 68.477586 8.418968 2.766967
69 2018 15.363442 31.882148 22.834796 5.726973 75.807359 8.438068 2.663138
70 2019 14.255763 35.258324 25.473071 6.351729 81.338886 8.451852 2.563228
0 0.706102
Name: Natural Gas Plant Liquids Production, dtype: float64
df1.tail(20)
new = df1[df1['Annual Total'] == 1949]
print(new['Natural Gas Plant Liquids Production'])
12/21/2020 Energy_DS - Jupyter Notebook
localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 3/9
In [6]:
Graph Total Renewable Energy Production 1984 - 2019
In [7]:
Graph Solar Energy Production Production since 1984 - 2019
Out[6]: [<matplotlib.lines.Line2D at 0x7f96fb59fe50>]
Out[7]: [<matplotlib.lines.Line2D at 0x7f96fb7ee1d0>]
fossil_fuels = df1['Total Fossil Fuels Production']
fossil_fuels = fossil_fuels[35:]
#figure(figsize=(50,5))
plt.plot(fossil_fuels)
#plt.xticks(range(70), range(1949, 2019, 1))
renewable_energy = df1['Total Renewable Energy Production']
renewable_energy = renewable_energy[35:]
plt.plot(renewable_energy)
12/21/2020 Energy_DS - Jupyter Notebook
localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 4/9
In [8]:
Modular Code - Calculate Growth Rate
In [9]:
Out[8]: [<matplotlib.lines.Line2D at 0x7f96fb8d3290>]
0.777084 0.570368
#1984, starts 1949
solar_energy = df1['Solar Energy Production']
#print(1949-1984)
solar_energy = solar_energy[35:]
plt.plot(solar_energy)
def get_energyproduction_number(year_selected, sector):
'''
Function that inputs year selected, and energy sector from energy produ
Outputs the energy produced (which is in quadrillion BTU) in exact year
'''
year = df1[df1['Annual Total'] == year_selected]
new_sector = year[sector]
new_sector = new_sector.iloc[0]
return new_sector
x = get_energyproduction_number(2017, 'Solar Energy Production')
y = get_energyproduction_number(2016, 'Solar Energy Production')
print(x,y)
12/21/2020 Energy_DS - Jupyter Notebook
localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 5/9
In [10]:
In [11]:
In [12]:
Out[10]: 2.0559089782613755
Out[12]: [<matplotlib.lines.Line2D at 0x7f96fb9b5510>]
def get_growth_rate(year1, year2, sector):
"""
Function that inputs two exacts energy production years
Function outputs the calculation of growth rate from one year to anothe
"""
year1_energy_produced = get_energyproduction_number(year1, sector)
year2_energy_produced = get_energyproduction_number(year2, sector)
growth_rate = (year2_energy_produced - year1_energy_produced)/year1_ene
return growth_rate
get_growth_rate(2000, 2001, 'Total Fossil Fuels Production')
def get_yearly_sector_growth(year1, year2, sector):
"""
Function that inputs sector
Outputs growth rate since inception date
"""
lst = []
while year1 < 2019:
x = get_growth_rate(year1, year2, sector)
lst.append(x)
year1 += 1
year2 += 1
return lst
list = get_yearly_sector_growth(2000, 2001, 'Total Renewable Energy Product
plt.plot(list)
12/21/2020 Energy_DS - Jupyter Notebook
localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 6/9
In [13]:
In [14]:
Out[13]: [-15.403905195088488,
11.02586476117117,
3.6916527276159896,
2.0227962561676858,
2.6084377661265084,
5.874329589127594,
-1.1520376639610785,
10.462989260052472,
6.026325911007182,
9.033916630338478,
11.857279532418646,
-4.446775262625664,
5.985639461905219,
3.7016095833647844,
-0.386545172654705,
7.134584913912513,
7.4168712807755925,
2.790667638568073,
0.002033303778008388]
get_yearly_sector_growth(2000, 2001, 'Total Renewable Energy Production')
def get_yearly_sector_growth(year1, year2, sector):
"""
Function that inputs sector
Outputs growth rate since inception date
"""
lst = []
while year1 < 2018:
x = get_growth_rate(year1, year2, sector)
lst.append(x)
year1 += 1
year2 += 1
return lst
12/21/2020 Energy_DS - Jupyter Notebook
localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 7/9
In [15]:
In [16]:
Out[15]: ([<matplotlib.axis.XTick at 0x7f96fb9e6e90>,
<matplotlib.axis.XTick at 0x7f96fb9e08d0>,
<matplotlib.axis.XTick at 0x7f96fb8feed0>,
<matplotlib.axis.XTick at 0x7f96fba29f90>,
<matplotlib.axis.XTick at 0x7f96fba9c410>,
<matplotlib.axis.XTick at 0x7f96fba9c210>,
<matplotlib.axis.XTick at 0x7f96fba9cd10>,
<matplotlib.axis.XTick at 0x7f96fbaa3390>,
<matplotlib.axis.XTick at 0x7f96fbaa3290>,
<matplotlib.axis.XTick at 0x7f96fbaaa350>,
<matplotlib.axis.XTick at 0x7f96fbaaa650>,
<matplotlib.axis.XTick at 0x7f96fbaaa510>,
<matplotlib.axis.XTick at 0x7f96fbab0310>,
<matplotlib.axis.XTick at 0x7f96fbab0210>,
<matplotlib.axis.XTick at 0x7f96fbab0e10>,
<matplotlib.axis.XTick at 0x7f96fbab0910>,
<matplotlib.axis.XTick at 0x7f96fbaa3990>,
<matplotlib.axis.XTick at 0x7f96fbab8510>],
<a list of 18 Text xticklabel objects>)
total_fossil_fuel_growthrate_year = get_yearly_sector_growth(2000, 2001, 'T
plt.plot(total_fossil_fuel_growthrate_year)
plt.xticks(range(0,18), range(2000,2018,1))
def get_average_growth(year1, year2, sector):
"""
Function that inputs a list of numbers, which are the growth rate of ea
Performs a calculation by summing all growth rates, and then divides th
Function outputs a number which is the avg growth rate.
"""
list_growth_rate = get_yearly_sector_growth(year1, year2, sector)
total_sum = sum(list_growth_rate)
avg_growth = total_sum/len(list_growth_rate)
return avg_growth
12/21/2020 Energy_DS - Jupyter Notebook
localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 8/9
In [17]:
In [18]:
In [19]:
In [20]:
In [21]:
In [22]:
In [23]:
In [24]:
In [25]:
In [26]:
Conclusion
Clearly, the average growth rate for Total Renewable Energy Production
has been twice the growth rate for Total Fossil Fuels Production from
1984-2019.
Additionally, in the last 20 years, Wind and Solar Energy Production have
been growing the fastest compared to other renewable energies.
Out[17]: 0.8007875658304962
Out[18]: 1.9340090984949878
Out[19]: 17.185792354542038
Out[20]: 0.2935477524487831
Out[21]: 1.3549097265165744
Out[22]: 24.245650340873755
Out[23]: 3.293788801373669
Out[24]: 3.7267783908048235
Out[25]: 4.787257846711986
Out[26]: 2.7995326374860046
get_average_growth(1984, 1985, 'Total Fossil Fuels Production')
get_average_growth(1984, 1985, 'Total Renewable Energy Production')
get_average_growth(2000, 2001, 'Solar Energy Production')
get_average_growth(2000, 2001, 'Hydroelectric Power Production')
get_average_growth(2000, 2001, 'Geothermal Energy Production')
get_average_growth(2000, 2001, 'Wind Energy Production')
get_average_growth(2000, 2001, 'Biomass Energy Production')
get_average_growth(2000, 2001, 'Crude Oil Production')
get_average_growth(2000, 2001, 'Natural Gas Plant Liquids Production')
get_average_growth(2000, 2001, 'Natural Gas (Dry) Production')
12/21/2020 Energy_DS - Jupyter Notebook
localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 9/9
In [ ]:

Contenu connexe

Similaire à Energy Analysis - Growth Rate 1984 - 2000 - 2019

Tablas Financieras de Factor Valor Actual y Valor Futuro Anualidades y Cantid...
Tablas Financieras de Factor Valor Actual y Valor Futuro Anualidades y Cantid...Tablas Financieras de Factor Valor Actual y Valor Futuro Anualidades y Cantid...
Tablas Financieras de Factor Valor Actual y Valor Futuro Anualidades y Cantid...emperatrizazul
 
Sample Calculations for solar rooftop project in India
Sample Calculations for solar rooftop project in IndiaSample Calculations for solar rooftop project in India
Sample Calculations for solar rooftop project in Indiadisruptiveenergy
 
PV Project Development Pre-Feasibility Financial Model
PV Project Development Pre-Feasibility Financial ModelPV Project Development Pre-Feasibility Financial Model
PV Project Development Pre-Feasibility Financial ModelFadi Maalouf, PMP
 
Tablice rozkładu t-studenta
Tablice rozkładu t-studentaTablice rozkładu t-studenta
Tablice rozkładu t-studentataskbook
 
03.3 homogeneous debt portfolios
03.3   homogeneous debt portfolios03.3   homogeneous debt portfolios
03.3 homogeneous debt portfolioscrmbasel
 
New Frontiers in the Political Economy of Minerals & Hydrocarbons: Section III
New Frontiers in the Political Economy of Minerals & Hydrocarbons: Section IIINew Frontiers in the Political Economy of Minerals & Hydrocarbons: Section III
New Frontiers in the Political Economy of Minerals & Hydrocarbons: Section IIIGraciela Chichilnisky
 
Trigonometric tables
Trigonometric tablesTrigonometric tables
Trigonometric tablesJayapal Jp
 
Trigonometric tables
Trigonometric tablesTrigonometric tables
Trigonometric tablesJayapal Jp
 
Numerical and Statistical Quantifications of Biodiversity: Two-At-A-Time Equa...
Numerical and Statistical Quantifications of Biodiversity: Two-At-A-Time Equa...Numerical and Statistical Quantifications of Biodiversity: Two-At-A-Time Equa...
Numerical and Statistical Quantifications of Biodiversity: Two-At-A-Time Equa...IJAEMSJORNAL
 
DOC-20221114-WA0004..pdf
DOC-20221114-WA0004..pdfDOC-20221114-WA0004..pdf
DOC-20221114-WA0004..pdfpankhimeena
 
Como se utiliza la tabla t de student
Como se utiliza la tabla t de student Como se utiliza la tabla t de student
Como se utiliza la tabla t de student Irving THdez
 
Tablas de ing_econ._1
Tablas de ing_econ._1Tablas de ing_econ._1
Tablas de ing_econ._1Lilia Estrada
 
Tabela de Fatores de Amortização.pdf
Tabela de Fatores de Amortização.pdfTabela de Fatores de Amortização.pdf
Tabela de Fatores de Amortização.pdfJeferson S. J.
 

Similaire à Energy Analysis - Growth Rate 1984 - 2000 - 2019 (20)

Tablas Financieras de Factor Valor Actual y Valor Futuro Anualidades y Cantid...
Tablas Financieras de Factor Valor Actual y Valor Futuro Anualidades y Cantid...Tablas Financieras de Factor Valor Actual y Valor Futuro Anualidades y Cantid...
Tablas Financieras de Factor Valor Actual y Valor Futuro Anualidades y Cantid...
 
Sample Calculations for solar rooftop project in India
Sample Calculations for solar rooftop project in IndiaSample Calculations for solar rooftop project in India
Sample Calculations for solar rooftop project in India
 
PV Project Development Pre-Feasibility Financial Model
PV Project Development Pre-Feasibility Financial ModelPV Project Development Pre-Feasibility Financial Model
PV Project Development Pre-Feasibility Financial Model
 
Tablice rozkładu t-studenta
Tablice rozkładu t-studentaTablice rozkładu t-studenta
Tablice rozkładu t-studenta
 
T table
T tableT table
T table
 
T table
T tableT table
T table
 
03.3 homogeneous debt portfolios
03.3   homogeneous debt portfolios03.3   homogeneous debt portfolios
03.3 homogeneous debt portfolios
 
New Frontiers in the Political Economy of Minerals & Hydrocarbons: Section III
New Frontiers in the Political Economy of Minerals & Hydrocarbons: Section IIINew Frontiers in the Political Economy of Minerals & Hydrocarbons: Section III
New Frontiers in the Political Economy of Minerals & Hydrocarbons: Section III
 
Trigonometric tables
Trigonometric tablesTrigonometric tables
Trigonometric tables
 
Trigonometric tables
Trigonometric tablesTrigonometric tables
Trigonometric tables
 
Rmv mxli valor de producción generado por las empresas a enero 2014
Rmv mxli  valor de producción generado por las empresas  a enero 2014Rmv mxli  valor de producción generado por las empresas  a enero 2014
Rmv mxli valor de producción generado por las empresas a enero 2014
 
Sanhuu udirdlaga
Sanhuu udirdlagaSanhuu udirdlaga
Sanhuu udirdlaga
 
Numerical and Statistical Quantifications of Biodiversity: Two-At-A-Time Equa...
Numerical and Statistical Quantifications of Biodiversity: Two-At-A-Time Equa...Numerical and Statistical Quantifications of Biodiversity: Two-At-A-Time Equa...
Numerical and Statistical Quantifications of Biodiversity: Two-At-A-Time Equa...
 
Agri
AgriAgri
Agri
 
DOC-20221114-WA0004..pdf
DOC-20221114-WA0004..pdfDOC-20221114-WA0004..pdf
DOC-20221114-WA0004..pdf
 
CRONY GROUP
CRONY GROUPCRONY GROUP
CRONY GROUP
 
Como se utiliza la tabla t de student
Como se utiliza la tabla t de student Como se utiliza la tabla t de student
Como se utiliza la tabla t de student
 
CAR Emails 6.12.02 (b)
CAR Emails 6.12.02 (b)CAR Emails 6.12.02 (b)
CAR Emails 6.12.02 (b)
 
Tablas de ing_econ._1
Tablas de ing_econ._1Tablas de ing_econ._1
Tablas de ing_econ._1
 
Tabela de Fatores de Amortização.pdf
Tabela de Fatores de Amortização.pdfTabela de Fatores de Amortização.pdf
Tabela de Fatores de Amortização.pdf
 

Dernier

Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 

Dernier (20)

Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 

Energy Analysis - Growth Rate 1984 - 2000 - 2019

  • 1. 12/21/2020 Energy_DS - Jupyter Notebook localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 1/9 Energy Production Analysis in the USA In this notebook we will be analyzing growth rates of energy production in the US. We will most likely want to compare Total Fossil Fuel Production with the Total Renewable Energy Production, to understand how the production as increased or decreased over the years. Additionally, we will calculate growth rate for both. Data is from 1949-2019. Note: Solar Energy Production started 1984 In [1]: In [2]: In [3]: Out[3]: Annual Total Coal Production Natural Gas (Dry) Production Crude Oil Production Natural Gas Plant Liquids Production Total Fossil Fuels Production Nuclear Electric Power Production Hydroelectric Power Production G P 0 1949 11.973882 5.377243 10.683252 0.706102 28.740479 0.0 1.424722 1 1950 14.060135 6.232975 11.446729 0.813366 32.553205 0.0 1.415411 2 1951 14.419325 7.415733 13.036724 0.910336 35.782118 0.0 1.423795 3 1952 12.734313 7.963599 13.281049 0.985701 34.964662 0.0 1.465812 4 1953 12.277746 8.338838 13.671076 1.050702 35.338361 0.0 1.412859 import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.pyplot import figure xls = pd.ExcelFile('Energy_Production_by_Source.xlsx') df1 = pd.read_excel(xls, 'Annual Data') df2 = pd.read_excel(xls, 'Monthly Data') df1.head()
  • 2. 12/21/2020 Energy_DS - Jupyter Notebook localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 2/9 In [4]: In [5]: Graph Total Fossil Fuels Production since 1984 - 2019 Out[4]: Annual Total Coal Production Natural Gas (Dry) Production Crude Oil Production Natural Gas Plant Liquids Production Total Fossil Fuels Production Nuclear Electric Power Production Hydroelectric Power Production 51 2000 22.735478 19.661529 12.358101 2.551466 57.306574 7.862349 2.811116 52 2001 23.547080 20.165567 12.281566 2.490533 58.484745 8.028853 2.241858 53 2002 22.732237 19.382055 12.160213 2.502206 56.776711 8.145429 2.689017 54 2003 22.093652 19.633304 11.959568 2.296059 55.982583 7.959622 2.792539 55 2004 22.852099 19.074254 11.550086 2.407581 55.884020 8.222774 2.688468 56 2005 23.185189 18.556015 10.974152 2.279946 54.995301 8.160810 2.702942 57 2006 23.789510 19.021706 10.766775 2.298717 55.876707 8.214626 2.869035 58 2007 23.492742 19.786209 10.741447 2.348716 56.369113 8.458589 2.446389 59 2008 23.851368 20.702884 10.613302 2.359299 57.526852 8.426491 2.511108 60 2009 21.623721 21.139450 11.340126 2.508252 56.611549 8.355220 2.668824 61 2010 22.038226 21.805763 11.610472 2.704829 58.159290 8.434433 2.538541 62 2011 22.221407 23.405720 11.997530 2.890075 60.514732 8.268698 3.102852 63 2012 20.676893 24.610065 13.841900 3.162126 62.290983 8.061822 2.628702 64 2013 20.001304 24.859072 15.865054 3.451386 64.176816 8.244433 2.562382 65 2014 20.285705 26.718073 18.607136 4.005085 69.615999 8.337559 2.466577 66 2015 17.946095 28.066882 19.712044 4.475993 70.201013 8.336886 2.321177 67 2016 14.667089 27.576023 18.537316 4.664785 65.445213 8.426753 2.472442 68 2017 15.625377 28.289335 19.575779 4.987096 68.477586 8.418968 2.766967 69 2018 15.363442 31.882148 22.834796 5.726973 75.807359 8.438068 2.663138 70 2019 14.255763 35.258324 25.473071 6.351729 81.338886 8.451852 2.563228 0 0.706102 Name: Natural Gas Plant Liquids Production, dtype: float64 df1.tail(20) new = df1[df1['Annual Total'] == 1949] print(new['Natural Gas Plant Liquids Production'])
  • 3. 12/21/2020 Energy_DS - Jupyter Notebook localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 3/9 In [6]: Graph Total Renewable Energy Production 1984 - 2019 In [7]: Graph Solar Energy Production Production since 1984 - 2019 Out[6]: [<matplotlib.lines.Line2D at 0x7f96fb59fe50>] Out[7]: [<matplotlib.lines.Line2D at 0x7f96fb7ee1d0>] fossil_fuels = df1['Total Fossil Fuels Production'] fossil_fuels = fossil_fuels[35:] #figure(figsize=(50,5)) plt.plot(fossil_fuels) #plt.xticks(range(70), range(1949, 2019, 1)) renewable_energy = df1['Total Renewable Energy Production'] renewable_energy = renewable_energy[35:] plt.plot(renewable_energy)
  • 4. 12/21/2020 Energy_DS - Jupyter Notebook localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 4/9 In [8]: Modular Code - Calculate Growth Rate In [9]: Out[8]: [<matplotlib.lines.Line2D at 0x7f96fb8d3290>] 0.777084 0.570368 #1984, starts 1949 solar_energy = df1['Solar Energy Production'] #print(1949-1984) solar_energy = solar_energy[35:] plt.plot(solar_energy) def get_energyproduction_number(year_selected, sector): ''' Function that inputs year selected, and energy sector from energy produ Outputs the energy produced (which is in quadrillion BTU) in exact year ''' year = df1[df1['Annual Total'] == year_selected] new_sector = year[sector] new_sector = new_sector.iloc[0] return new_sector x = get_energyproduction_number(2017, 'Solar Energy Production') y = get_energyproduction_number(2016, 'Solar Energy Production') print(x,y)
  • 5. 12/21/2020 Energy_DS - Jupyter Notebook localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 5/9 In [10]: In [11]: In [12]: Out[10]: 2.0559089782613755 Out[12]: [<matplotlib.lines.Line2D at 0x7f96fb9b5510>] def get_growth_rate(year1, year2, sector): """ Function that inputs two exacts energy production years Function outputs the calculation of growth rate from one year to anothe """ year1_energy_produced = get_energyproduction_number(year1, sector) year2_energy_produced = get_energyproduction_number(year2, sector) growth_rate = (year2_energy_produced - year1_energy_produced)/year1_ene return growth_rate get_growth_rate(2000, 2001, 'Total Fossil Fuels Production') def get_yearly_sector_growth(year1, year2, sector): """ Function that inputs sector Outputs growth rate since inception date """ lst = [] while year1 < 2019: x = get_growth_rate(year1, year2, sector) lst.append(x) year1 += 1 year2 += 1 return lst list = get_yearly_sector_growth(2000, 2001, 'Total Renewable Energy Product plt.plot(list)
  • 6. 12/21/2020 Energy_DS - Jupyter Notebook localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 6/9 In [13]: In [14]: Out[13]: [-15.403905195088488, 11.02586476117117, 3.6916527276159896, 2.0227962561676858, 2.6084377661265084, 5.874329589127594, -1.1520376639610785, 10.462989260052472, 6.026325911007182, 9.033916630338478, 11.857279532418646, -4.446775262625664, 5.985639461905219, 3.7016095833647844, -0.386545172654705, 7.134584913912513, 7.4168712807755925, 2.790667638568073, 0.002033303778008388] get_yearly_sector_growth(2000, 2001, 'Total Renewable Energy Production') def get_yearly_sector_growth(year1, year2, sector): """ Function that inputs sector Outputs growth rate since inception date """ lst = [] while year1 < 2018: x = get_growth_rate(year1, year2, sector) lst.append(x) year1 += 1 year2 += 1 return lst
  • 7. 12/21/2020 Energy_DS - Jupyter Notebook localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 7/9 In [15]: In [16]: Out[15]: ([<matplotlib.axis.XTick at 0x7f96fb9e6e90>, <matplotlib.axis.XTick at 0x7f96fb9e08d0>, <matplotlib.axis.XTick at 0x7f96fb8feed0>, <matplotlib.axis.XTick at 0x7f96fba29f90>, <matplotlib.axis.XTick at 0x7f96fba9c410>, <matplotlib.axis.XTick at 0x7f96fba9c210>, <matplotlib.axis.XTick at 0x7f96fba9cd10>, <matplotlib.axis.XTick at 0x7f96fbaa3390>, <matplotlib.axis.XTick at 0x7f96fbaa3290>, <matplotlib.axis.XTick at 0x7f96fbaaa350>, <matplotlib.axis.XTick at 0x7f96fbaaa650>, <matplotlib.axis.XTick at 0x7f96fbaaa510>, <matplotlib.axis.XTick at 0x7f96fbab0310>, <matplotlib.axis.XTick at 0x7f96fbab0210>, <matplotlib.axis.XTick at 0x7f96fbab0e10>, <matplotlib.axis.XTick at 0x7f96fbab0910>, <matplotlib.axis.XTick at 0x7f96fbaa3990>, <matplotlib.axis.XTick at 0x7f96fbab8510>], <a list of 18 Text xticklabel objects>) total_fossil_fuel_growthrate_year = get_yearly_sector_growth(2000, 2001, 'T plt.plot(total_fossil_fuel_growthrate_year) plt.xticks(range(0,18), range(2000,2018,1)) def get_average_growth(year1, year2, sector): """ Function that inputs a list of numbers, which are the growth rate of ea Performs a calculation by summing all growth rates, and then divides th Function outputs a number which is the avg growth rate. """ list_growth_rate = get_yearly_sector_growth(year1, year2, sector) total_sum = sum(list_growth_rate) avg_growth = total_sum/len(list_growth_rate) return avg_growth
  • 8. 12/21/2020 Energy_DS - Jupyter Notebook localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 8/9 In [17]: In [18]: In [19]: In [20]: In [21]: In [22]: In [23]: In [24]: In [25]: In [26]: Conclusion Clearly, the average growth rate for Total Renewable Energy Production has been twice the growth rate for Total Fossil Fuels Production from 1984-2019. Additionally, in the last 20 years, Wind and Solar Energy Production have been growing the fastest compared to other renewable energies. Out[17]: 0.8007875658304962 Out[18]: 1.9340090984949878 Out[19]: 17.185792354542038 Out[20]: 0.2935477524487831 Out[21]: 1.3549097265165744 Out[22]: 24.245650340873755 Out[23]: 3.293788801373669 Out[24]: 3.7267783908048235 Out[25]: 4.787257846711986 Out[26]: 2.7995326374860046 get_average_growth(1984, 1985, 'Total Fossil Fuels Production') get_average_growth(1984, 1985, 'Total Renewable Energy Production') get_average_growth(2000, 2001, 'Solar Energy Production') get_average_growth(2000, 2001, 'Hydroelectric Power Production') get_average_growth(2000, 2001, 'Geothermal Energy Production') get_average_growth(2000, 2001, 'Wind Energy Production') get_average_growth(2000, 2001, 'Biomass Energy Production') get_average_growth(2000, 2001, 'Crude Oil Production') get_average_growth(2000, 2001, 'Natural Gas Plant Liquids Production') get_average_growth(2000, 2001, 'Natural Gas (Dry) Production')
  • 9. 12/21/2020 Energy_DS - Jupyter Notebook localhost:8888/notebooks/%231 REMCO/Energy_DS.ipynb 9/9 In [ ]: