@@ -147,7 +147,9 @@ def get_fert(
147
147
"68" , country_id = country_id , start_year = start_year , end_year = end_year
148
148
)
149
149
if download_path :
150
- df .to_csv (os .path .join (download_path , "raw_fert_data_UN.csv" ), index = False )
150
+ df .to_csv (
151
+ os .path .join (download_path , "raw_fert_data_UN.csv" ), index = False
152
+ )
151
153
# CLean and rebin data
152
154
for y in range (start_year , end_year + 1 ):
153
155
df_y = df [(df .age >= min_age ) & (df .age <= max_age ) & (df .year == y )]
@@ -235,7 +237,9 @@ def get_mort(
235
237
"80" , country_id = country_id , start_year = start_year , end_year = end_year
236
238
)
237
239
if download_path :
238
- df .to_csv (os .path .join (download_path , "raw_mort_data_UN.csv" ), index = False )
240
+ df .to_csv (
241
+ os .path .join (download_path , "raw_mort_data_UN.csv" ), index = False
242
+ )
239
243
# CLean and rebin data
240
244
for y in range (start_year , end_year + 1 ):
241
245
df_y = df [(df .age >= min_age ) & (df .age <= max_age ) & (df .year == y )]
@@ -350,7 +354,10 @@ def get_pop(
350
354
end_year = start_year - 1 ,
351
355
)
352
356
if download_path :
353
- pre_pop_data .to_csv (os .path .join (download_path , "raw_pre_pop_data_UN.csv" ), index = False )
357
+ pre_pop_data .to_csv (
358
+ os .path .join (download_path , "raw_pre_pop_data_UN.csv" ),
359
+ index = False ,
360
+ )
354
361
pre_pop_sample = pre_pop_data [
355
362
(pre_pop_data ["age" ] >= min_age )
356
363
& (pre_pop_data ["age" ] <= max_age )
@@ -404,7 +411,9 @@ def get_pop(
404
411
+ 2 , # note go to + 2 because needed to infer immigration for end_year
405
412
)
406
413
if download_path :
407
- pop_data .to_csv (os .path .join (download_path , "raw_pop_data_UN.csv" ), index = False )
414
+ pop_data .to_csv (
415
+ os .path .join (download_path , "raw_pop_data_UN.csv" ), index = False
416
+ )
408
417
# CLean and rebin data
409
418
for y in range (start_year , end_year + 2 ):
410
419
pop_data_sample = pop_data [
0 commit comments