Skip to content

Commit

Permalink
Flag former countries (#10)
Browse files Browse the repository at this point in the history
* initialize former_country flag

* bump version
  • Loading branch information
bleonard33 authored Feb 28, 2020
1 parent e42ed95 commit 9c37d56
Show file tree
Hide file tree
Showing 3 changed files with 259 additions and 1 deletion.
6 changes: 6 additions & 0 deletions location/International/Atlas/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ def get_wdi_data():
services, left_on="code", right_index=True, how="left"
)

former = pd.read_csv("./in/former_countries.csv", index_col="code")
former = former.astype(float)
parent_id_table = parent_id_table.merge(
former, left_on="code", right_index=True, how="left"
)

# Services flags should be False in case of regions, per Huy's request
parent_id_table.loc[parent_id_table.level == "region", "reported_serv"] = 0
parent_id_table.loc[parent_id_table.level == "region", "reported_serv_recent"] = 0
Expand Down
252 changes: 252 additions & 0 deletions location/International/Atlas/in/former_countries.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
code,former_country
ABW,FALSE
AFG,FALSE
AGO,FALSE
AIA,FALSE
ALB,FALSE
AND,FALSE
ANT,FALSE
ARE,FALSE
ARG,FALSE
ARM,FALSE
ASM,FALSE
ATA,FALSE
ATF,FALSE
ATG,FALSE
AUS,FALSE
AUT,FALSE
AZE,FALSE
BDI,FALSE
BEL,FALSE
BEN,FALSE
BES,FALSE
BFA,FALSE
BGD,FALSE
BGR,FALSE
BHR,FALSE
BHS,FALSE
BIH,FALSE
BLM,FALSE
BLR,FALSE
BLZ,FALSE
BMU,FALSE
BOL,FALSE
BRA,FALSE
BRB,FALSE
BRN,FALSE
BTN,FALSE
BVT,FALSE
BWA,FALSE
CAF,FALSE
CAN,FALSE
CCK,FALSE
CHE,FALSE
CHL,FALSE
CHN,FALSE
CIV,FALSE
CMR,FALSE
COD,FALSE
COG,FALSE
COK,FALSE
COL,FALSE
COM,FALSE
CPV,FALSE
CRI,FALSE
CSK,FALSE
CUB,FALSE
CUW,FALSE
CXR,FALSE
CYM,FALSE
CYP,FALSE
CZE,FALSE
DDR,TRUE
DEU,FALSE
DJI,FALSE
DMA,FALSE
DNK,FALSE
DOM,FALSE
DZA,FALSE
ECU,FALSE
EGY,FALSE
ERI,FALSE
ESH,FALSE
ESP,FALSE
EST,FALSE
ETH,FALSE
FIN,FALSE
FJI,FALSE
FLK,FALSE
FRA,FALSE
FRO,FALSE
FSM,FALSE
GAB,FALSE
GBR,FALSE
GEO,FALSE
GHA,FALSE
GIB,FALSE
GIN,FALSE
GLP,FALSE
GMB,FALSE
GNB,FALSE
GNQ,FALSE
GRC,FALSE
GRD,FALSE
GRL,FALSE
GTM,FALSE
GUF,FALSE
GUM,FALSE
GUY,FALSE
HKG,FALSE
HMD,FALSE
HND,FALSE
HRV,FALSE
HTI,FALSE
HUN,FALSE
IDN,FALSE
IND,FALSE
IOT,FALSE
IRL,FALSE
IRN,FALSE
IRQ,FALSE
ISL,FALSE
ISR,FALSE
ITA,FALSE
JAM,FALSE
JOR,FALSE
JPN,FALSE
KAZ,FALSE
KEN,FALSE
KGZ,FALSE
KHM,FALSE
KIR,FALSE
KNA,FALSE
KOR,FALSE
KWT,FALSE
LAO,FALSE
LBN,FALSE
LBR,FALSE
LBY,FALSE
LCA,FALSE
LKA,FALSE
LSO,FALSE
LTU,FALSE
LUX,FALSE
LVA,FALSE
MAC,FALSE
MAR,FALSE
MDA,FALSE
MDG,FALSE
MDV,FALSE
MEX,FALSE
MHL,FALSE
MKD,FALSE
MLI,FALSE
MLT,FALSE
MMR,FALSE
MNE,FALSE
MNG,FALSE
MNP,FALSE
MOZ,FALSE
MRT,FALSE
MSR,FALSE
MTQ,FALSE
MUS,FALSE
MWI,FALSE
MYS,FALSE
MYT,FALSE
NAM,FALSE
NCL,FALSE
NER,FALSE
NFK,FALSE
NGA,FALSE
NIC,FALSE
NIU,FALSE
NLD,FALSE
NOR,FALSE
NPL,FALSE
NRU,FALSE
NZL,FALSE
OMN,FALSE
PAK,FALSE
PAN,FALSE
PCI,TRUE
PCN,FALSE
PCZ,FALSE
PER,FALSE
PHL,FALSE
PLW,FALSE
PNG,FALSE
POL,FALSE
PRK,FALSE
PRT,FALSE
PRY,FALSE
PSE,FALSE
PYF,FALSE
QAT,FALSE
REU,FALSE
ROU,FALSE
RUS,FALSE
RWA,FALSE
SAU,FALSE
SCG,FALSE
SDN,FALSE
SEN,FALSE
SGP,FALSE
SGS,FALSE
SHN,FALSE
SLB,FALSE
SLE,FALSE
SLV,FALSE
SMR,FALSE
SOM,FALSE
SPM,FALSE
SRB,FALSE
SSD,FALSE
STP,FALSE
SUN,TRUE
SUR,FALSE
SVK,FALSE
SVN,FALSE
SWE,FALSE
SWZ,FALSE
SXM,FALSE
SYC,FALSE
SYR,FALSE
TCA,FALSE
TCD,FALSE
TGO,FALSE
THA,FALSE
TJK,FALSE
TKL,FALSE
TKM,FALSE
TLS,FALSE
TON,FALSE
TTO,FALSE
TUN,FALSE
TUR,FALSE
TUV,FALSE
TZA,FALSE
UGA,FALSE
UKR,FALSE
UMI,FALSE
URY,FALSE
USA,FALSE
UZB,FALSE
VAT,FALSE
VCT,FALSE
VDR,TRUE
VEN,FALSE
VGB,FALSE
VIR,FALSE
VNM,FALSE
VUT,FALSE
WLF,FALSE
WSM,FALSE
YEM,FALSE
YMD,TRUE
YUG,FALSE
ZAF,FALSE
ZMB,FALSE
ZWE,FALSE
TWN,FALSE
ANS,FALSE
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="linnaeus",
version="v113",
version="v115",
author="Mali Akmanalp <Harvard CID>",
description=("Harvard CID's classification tools."),
url="http://github.com/cid-harvard/classifications/",
Expand Down

0 comments on commit 9c37d56

Please sign in to comment.