fix(code): Differentiate between national and census data

This commit is contained in:
Marty Oehme 2024-02-14 22:35:35 +01:00
parent a51d55e3a5
commit 588cf4a3c9
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,7 @@
# Summary of study findings
written into 02-data/supplementary/findings-*.csv tables
## Institutional
### Labour laws / regulatory systems

View file

@ -18,9 +18,9 @@ def calculate_validities(
vd[repr_col] = vd[repr_col].fillna("")
vd[method_col] = vd[method_col].fillna("")
# needs to check national before subnational, subnational before local
vd.loc[vd[repr_col].str.contains("national"), EXT_COL_NAME] = 5.0
vd.loc[vd[repr_col].str.contains("regional"), EXT_COL_NAME] = 4.0
# needs to check national before subnational and census, subnational before local
vd.loc[vd[repr_col].str.contains("|".join(["national", "regional"])), EXT_COL_NAME] = 4.0
vd.loc[vd[repr_col].str.contains("census"), EXT_COL_NAME] = 5.0
vd.loc[vd[repr_col].str.contains("subnational"), EXT_COL_NAME] = 3.0
vd.loc[vd[repr_col].str.contains("local"), EXT_COL_NAME] = 2.0