In [1]:
import pandas as pd

In [2]:
import targetsmosh as tm

In [29]:
ghgfins = pd.read_pickle("../CDPdata/s12_ghgfins.pkl")
targets = pd.read_pickle("../CDPdata/targets_all.pkl")

In [30]:
targets = targets.reset_index().set_index(["Organisation", "year"])
ghgfintars = ghgfins.join(targets[["has absolute", "has intensity", "target type"]])

In [31]:
# some years for some companies don't have target infos
# set them all to false
ghgfintars["has absolute"].fillna(False, inplace=True)
ghgfintars["has intensity"].fillna(False, inplace=True)

In [32]:
# i should compare first by GICS Industry Group
ghgfintars.to_pickle("../CDPdata/ghgfintars.pkl")
ghgfintars.head()


Out[32]:
Country GICS Industry GICS Sector scope1 scope2 Revenues COGS Equity PPE Assets Income 1and2 total 1and2 intensity has absolute has intensity target type
Organisation year
3M Company 2009 USA Industrial Conglomerates Industrials 3290000 1690000 24939.230138 11709.779078 13766.567205 7549.825324 29390.391440 3443.798894 4980000 199.685394 False False NaN
2010 USA Industrial Conglomerates Industrials 4300000 1950000 28294.483474 13489.279853 16622.027404 7724.684765 32002.417059 4335.119833 6250000 220.891115 True False Absolute emissions reduction
2011 USA Industrial Conglomerates Industrials 4060000 2030000 30530.950861 14906.148276 15899.066640 7904.166334 32598.241952 4416.063711 6090000 199.469713 False True Intensity target
2012 USA Industrial Conglomerates Industrials 4540000 2230000 30349.027827 14611.254468 17836.549092 8502.680415 34380.138666 4510.135088 6770000 223.071396 False True Intensity target
2013 USA Industrial Conglomerates Industrials 4550000 2230000 30843.417282 14721.834526 17486.362258 8644.269584 33520.023641 4654.837262 6780000 219.820000 False False No

In [33]:
# get company counts again.  it should be the same as for ghgfins
len(ghgfintars.index.levels[0].value_counts().index) #1243 instead of 1247 requested from COMPUSTAT
len(ghgfintars) # 4673


Out[33]:
4673

plot results


In [5]:
import numpy as np
from collections import OrderedDict
from bokeh.charts import Scatter
from bokeh.charts import Histogram
from bokeh.plotting import output_notebook, show
output_notebook()
import datavis as dv