-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathScript_1.py
More file actions
49 lines (37 loc) · 1.09 KB
/
Script_1.py
File metadata and controls
49 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 23 15:56:55 2019
@author: subhro
"""
from scrapCountry import ScrapCountry
import wikiScrap
import pandas as pd
import datetime
#import numpy as np
#import matplotlib.pyplot as plt
start = datetime.datetime.now()
cl = ScrapCountry()
cl.saveList(cl.getCountryList())
df = pd.read_csv('Countries.csv')
iList = []
pList = []
gList = []
hList = []
cList = []
for country in df['Country']:
obj = wikiScrap.WebScrap(country)
iList.append(obj.perCapitaIncome())
pList.append(obj.population())
gList.append(obj.giniCoefficient())
hList.append(obj.humanDevIndex())
cList.append(country)
del obj
worldDevInfo = pd.DataFrame({'Country':cList,
'Per Capita Income':iList,
'Population':pList,
'Gini Coefficient':gList,
'Human Development Index':hList})
worldDevInfo.to_csv('World_Development_Info.csv',index = False)
end = datetime.datetime.now()
print('Total time taken: ',(end - start))