Commit
·
de9d710
1
Parent(s):
458a656
Update Climate_site/python_scripts/functions_companies.py
Browse files
Climate_site/python_scripts/functions_companies.py
CHANGED
|
@@ -6,14 +6,17 @@ import pandas as pd
|
|
| 6 |
import re
|
| 7 |
import json
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
def load_dic():
|
| 10 |
-
f = open("
|
| 11 |
dic_companies = json.load(f)
|
| 12 |
return dic_companies
|
| 13 |
|
| 14 |
|
| 15 |
def load_data():
|
| 16 |
-
url = "
|
| 17 |
table = pd.read_csv(url, delimiter = "\t" , index_col = 0)
|
| 18 |
table = table.astype({'portfolio_company_id': 'str'})
|
| 19 |
|
|
@@ -29,7 +32,7 @@ dic_companies = load_dic()
|
|
| 29 |
|
| 30 |
def print_extracted_text(name_file):
|
| 31 |
|
| 32 |
-
file = open('
|
| 33 |
lines = file.readlines()
|
| 34 |
count = 0
|
| 35 |
for index, line in enumerate(lines):
|
|
@@ -43,7 +46,7 @@ def print_extracted_text(name_file):
|
|
| 43 |
|
| 44 |
def details(name_file , display):
|
| 45 |
|
| 46 |
-
file = open("
|
| 47 |
lines = file.readlines()
|
| 48 |
|
| 49 |
mark = 0
|
|
@@ -86,7 +89,7 @@ def details(name_file , display):
|
|
| 86 |
|
| 87 |
def key_initiatives(name_file , display ):
|
| 88 |
|
| 89 |
-
file = open('
|
| 90 |
lines = file.readlines()
|
| 91 |
|
| 92 |
|
|
@@ -131,7 +134,7 @@ def key_initiatives(name_file , display ):
|
|
| 131 |
|
| 132 |
def deployment_target(name_file , display):
|
| 133 |
|
| 134 |
-
file = open('
|
| 135 |
lines = file.readlines()
|
| 136 |
|
| 137 |
|
|
@@ -175,7 +178,7 @@ def deployment_target(name_file , display):
|
|
| 175 |
|
| 176 |
def cost_reduction_target(name_file , display):
|
| 177 |
|
| 178 |
-
file = open('
|
| 179 |
lines = file.readlines()
|
| 180 |
|
| 181 |
mark = 0
|
|
@@ -220,7 +223,7 @@ def cost_reduction_target(name_file , display):
|
|
| 220 |
|
| 221 |
def key_words(name_file, display ):
|
| 222 |
|
| 223 |
-
file = open('
|
| 224 |
|
| 225 |
lines = file.readlines()
|
| 226 |
|
|
@@ -299,7 +302,7 @@ def key_words(name_file, display ):
|
|
| 299 |
|
| 300 |
def technology(name_file, display ):
|
| 301 |
# Filepath too specific, need to change to relative path
|
| 302 |
-
file = open('
|
| 303 |
lines = file.readlines()
|
| 304 |
|
| 305 |
list_categories = []
|
|
|
|
| 6 |
import re
|
| 7 |
import json
|
| 8 |
|
| 9 |
+
|
| 10 |
+
path = 'Climate_site/python_scripts/'
|
| 11 |
+
|
| 12 |
def load_dic():
|
| 13 |
+
f = open(path + "related_companies.json","r")
|
| 14 |
dic_companies = json.load(f)
|
| 15 |
return dic_companies
|
| 16 |
|
| 17 |
|
| 18 |
def load_data():
|
| 19 |
+
url = path + "preqin_companies_IEA.tsv"
|
| 20 |
table = pd.read_csv(url, delimiter = "\t" , index_col = 0)
|
| 21 |
table = table.astype({'portfolio_company_id': 'str'})
|
| 22 |
|
|
|
|
| 32 |
|
| 33 |
def print_extracted_text(name_file):
|
| 34 |
|
| 35 |
+
file = open(path + 'iea.txt', "r", encoding='utf8')
|
| 36 |
lines = file.readlines()
|
| 37 |
count = 0
|
| 38 |
for index, line in enumerate(lines):
|
|
|
|
| 46 |
|
| 47 |
def details(name_file , display):
|
| 48 |
|
| 49 |
+
file = open(path + "iea.txt", "r")
|
| 50 |
lines = file.readlines()
|
| 51 |
|
| 52 |
mark = 0
|
|
|
|
| 89 |
|
| 90 |
def key_initiatives(name_file , display ):
|
| 91 |
|
| 92 |
+
file = open(path + 'iea.txt', "r", encoding='utf8')
|
| 93 |
lines = file.readlines()
|
| 94 |
|
| 95 |
|
|
|
|
| 134 |
|
| 135 |
def deployment_target(name_file , display):
|
| 136 |
|
| 137 |
+
file = open(path + 'iea.txt', "r", encoding='utf8')
|
| 138 |
lines = file.readlines()
|
| 139 |
|
| 140 |
|
|
|
|
| 178 |
|
| 179 |
def cost_reduction_target(name_file , display):
|
| 180 |
|
| 181 |
+
file = open(path + 'iea.txt', "r", encoding='utf8')
|
| 182 |
lines = file.readlines()
|
| 183 |
|
| 184 |
mark = 0
|
|
|
|
| 223 |
|
| 224 |
def key_words(name_file, display ):
|
| 225 |
|
| 226 |
+
file = open(path + 'iea.txt', "r", encoding='utf8')
|
| 227 |
|
| 228 |
lines = file.readlines()
|
| 229 |
|
|
|
|
| 302 |
|
| 303 |
def technology(name_file, display ):
|
| 304 |
# Filepath too specific, need to change to relative path
|
| 305 |
+
file = open(path + 'iea.txt', "r", encoding='utf8')
|
| 306 |
lines = file.readlines()
|
| 307 |
|
| 308 |
list_categories = []
|