Trends on emission data – python code

# %load ../standard_import.txt
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
import seaborn as sns

from sklearn.preprocessing import scale
import sklearn.linear_model as skl_lm
from sklearn.metrics import mean_squared_error, r2_score
import statsmodels.api as sm
import statsmodels.formula.api as smf

%matplotlib inline
plt.style.use('seaborn-white')
# https://catalog.data.gov/dataset/greenhouse-gas-emissions-from-fuel-combustion-million-metric-tons-beginning-1990
df = pd.read_csv('/.../GreenhouseEmissions.csv') # add your location for your file in ...

df.head()
sns.regplot(df.Year, df.Commercial, order=1, ci=None, scatter_kws={'color':'r', 's':9})
plt.xlim(1990, 2016)
plt.ylim(15,40);
sns.jointplot(x='Year',y='Transportation',data=df,kind='reg')
sns.pairplot(df)

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.