In [36]:
#Script to read regional stats files for BU and TD approach. 
#Values for SumSources mean, min, max written manually into index.html

#Created:       16.09.2016
#Last modified:

In [1]:
import numpy as np
import pandas as pd
import collections
import os
import xlrd

In [11]:
#df_BU = pd.read_csv("../data/Sankey_BU_2003-2012_25MAy2016.txt", header=1, delim_whitespace=True)
df_BU = pd.read_csv("../data/Sankey_BU_2003-2012_sept2016.txt", header=1, delim_whitespace=True)
df_BU.rename(columns = {'proc':'stats'}, inplace = True)
df_BU.index.name = 'proc'
df_BU


Out[11]:
stats Bor_NAme contUSA Cent_NAme Trop_SAme Temp_SAme NAfr SAfr Russia Oceania Europe China India SE_Asia Temp_Eurasia_Japan GLO
proc
Wetlands mean 32 13 2 42 4 8 19 14 3 4 5 6 29 3 185
Wetlands min 15 6 1 19 1 3 15 5 1 1 1 1 18 1 153
Wetlands max 61 23 4 59 7 16 22 26 6 7 9 13 35 6 227
OtherNatural mean -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 199
OtherNatural min -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 104
OtherNatural max -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 297
AgriWaste mean 3 17 5 21 6 14 6 5 5 17 30 21 22 20 195
AgriWaste min 2 15 2 18 5 12 5 5 5 15 23 16 18 17 178
AgriWaste max 3 23 6 23 6 18 7 5 5 18 36 24 25 22 206
Fossil mean 2 11 2 8 1 9 4 20 2 6 24 3 6 22 121
Fossil min 1 9 0 3 1 7 3 18 1 3 15 2 5 20 114
Fossil max 3 16 3 19 1 14 5 26 2 8 31 4 7 26 133
BioBurBiof mean 1 1 1 3 0 4 6 2 1 1 3 2 5 1 30
BioBurBiof min 0 0 0 1 0 3 4 0 0 0 2 2 4 1 27
BioBurBiof max 1 2 1 6 1 5 10 4 1 1 4 3 5 2 35
SumSources mean 37 42 9 75 11 36 35 41 10 28 61 32 63 47 537
SumSources min 19 31 3 47 7 25 27 28 7 22 43 23 44 42 492
SumSources max 66 63 13 103 14 53 47 60 14 34 79 42 73 54 587

In [12]:
df_TD = pd.read_csv("../data/Sankey_TD_2003-2012_sept2016.txt", header=1, delim_whitespace=True)
df_TD.rename(columns = {'proc':'stats'}, inplace = True)
df_TD.index.name = 'proc'
df_TD


Out[12]:
stats Bor_NAme contUSA Cent_NAme Trop_SAme Temp_SAme NAfr SAfr Russia Oceania Europe China India SE_Asia Temp_Eurasia_Japan GLO
proc
Wetlands mean 13 9 2 44 8 12 20 13 3 2 5 6 27 3 167
Wetlands min 7 6 1 30 4 8 11 10 1 1 3 0 8 1 127
Wetlands max 21 13 3 61 10 14 29 16 2 4 7 10 41 5 202
OtherNatural mean 2 3 1 9 2 6 6 2 3 3 6 4 9 4 64
OtherNatural min 0 1 0 5 1 3 4 1 1 0 1 1 2 1 21
OtherNatural max 4 9 2 22 2 11 11 4 3 2 16 12 26 13 132
AgriWaste mean 3 18 5 21 6 12 7 5 4 15 27 25 24 19 188
AgriWaste min 2 16 2 19 5 11 7 3 3 9 16 14 12 9 115
AgriWaste max 4 23 8 27 8 15 9 7 5 19 37 43 32 24 243
Fossil mean 2 12 2 4 1 7 4 17 1 7 18 3 8 20 105
Fossil min 1 7 0 1 0 3 2 11 0 5 9 1 5 14 77
Fossil max 4 18 3 8 1 8 5 24 2 9 30 4 14 27 133
BioBurBiof mean 1 0 1 7 0 5 6 1 1 1 3 2 6 1 34
BioBurBiof min 0 0 0 3 0 2 4 1 0 0 0 0 3 0 15
BioBurBiof max 1 1 1 15 1 6 9 2 1 1 4 3 8 1 53
SumSources mean 20 41 11 84 17 42 44 38 11 28 58 39 74 46 558
SumSources min 13 34 5 65 12 36 38 31 7 21 51 28 55 38 540
SumSources max 27 49 15 101 27 55 53 45 19 34 72 46 84 54 568

In [ ]: