# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import pyam
import numpy as np
import matplotlib.ticker as mtick

# ## BP

# https://www.bp.com/en/global/corporate/energy-economics/energy-outlook.html

df = pd.read_excel("data/bp-energy-outlook-2020-chart-data-pack.xlsx",
                  sheet_name = "Gas Share",
                  skiprows =3, index_col = "Scenarios")
df

# +
#fix, ax = plt.subplots()
df.T.plot()
plt.title("Gas share in global power generation \n BP Energy Outlook 2020")
plt.ylabel("Share (0-1")
#ax.yaxis.set_major_formatter(mtick.PercentFormatter())
plt.savefig("figures/Gas share in global power generation BP Energy Outlook",
           dpi = 300)

plt.show()
# -

# ## IEA

# +
df = pd.read_excel("data/NZE2021_AnnexA.xlsx",
                  sheet_name = "World_Elec",
                  skiprows=4,
                  usecols=[0,1,2,3,4,5], 
                  index_col = "Fuels")
df = df.iloc[0:19]

#Take a subset of only gas-based generation
df = df.loc[["Unabated Natural gas","Natural gas with CCUS", "Total generation"]]
df=df.T
df
# -

df["Unabated Natural gas share"] = df["Unabated Natural gas"]/df["Total generation"]
df["Natural gas with CCUS share"] = df["Natural gas with CCUS"]/df["Total generation"]
df

df.to_excel("data/IEA Gas NZE.xlsx")

df.iloc[:,:2].plot(kind = "area", stacked = True)
plt.ylabel("TWh")
plt.title("Global Electricitiy Generation from Gas\n IEA Net Zero Scenario 2021")
plt.savefig("figures/Global electricity generation from gas in IEA Net Zero 2021 scenario", dpi = 300)
plt.show()

df.iloc[:,3:].plot(kind = "area", stacked = True)
plt.ylabel("Share (0-1")
plt.title("Gas share in global electricitiy generation\n IEA Net Zero Scenario 2021")
plt.savefig("figures/Gas share in global electricity generation IEA Net Zero 2021 scenario", dpi = 300)
plt.show()

# ## Shell 

# https://www.shell.com/energy-and-innovation/the-energy-future/scenarios/the-energy-transformation-scenarios.html#iframe=L3dlYmFwcHMvU2NlbmFyaW9zX2xvbmdfaG9yaXpvbnMv

# +
file = "data\shell-energy-transformation-scenarios-summary-data.xlsx"
shell = pd.read_excel(file, sheet_name = "Sheet1", skiprows = 23)
shell.columns=shell.iloc[0]

shell.drop(shell.index[0], axis=0, inplace=True)
shell.set_index("Scenarios",inplace=True)

shell.columns = shell.columns.astype(int)

shell= shell.T
shell
# -

shell.plot()
plt.title("Gas share in global electricity generation \n Shell Energy Transformation Scenarios 2021")
plt.ylabel("Share (0-1")
plt.xlabel("Years")
plt.savefig("figures/Gas share in global electricity generation Shell", dpi = 300)
plt.show()





StarcoderdataJupyterScriptsDedupFiltered