def _save_wp_as_txt_with_reordering_columns(wp_csv): # csv columns (input): # 0 longitude,latitude,"","workplace_id","stcotr", # 5 "employees","placed","wkb_geometry" # text columns (output): # sp_id,workers,latitude,longitude aid.reorder_and_check_header(wp_csv, [4, 6, 2, 1], 'workplaces.txt-us')
def _save_sc_as_txt_with_reordering_columns(sc_csv): # csv columns (input): # 0 "","School","ID","CoNo","StNo", # 5 "Long","Lat","Low","High","Students", # 10 made-empty # text columns (output): # sp_id,name,stabbr,address,city, # county,zipcode,zip4,nces_id,total, # prek,kinder,gr01_gr1 sc_columns = [ 3, 2, 5, 11, 11, 4, 11, 11, 11, 10, 11, 11, 11, 11, 7, 6, 11, 11 ] aid.reorder_and_check_header(sc_csv, sc_columns, 'schools.txt-us')
def _save_hh_as_txt_with_reordering_columns(hh_csv, gq_csv): """ csv columns (input): 0 SERIALNO,puma_id,place_id,SYNTHETIC_HID,longitude, 5 latitude,AGEGRP,HRSWRK,IMMSTAT,INCTAX, 10 MODE,OCC,POB,RELIGION,SEX, 15 SYNTHETIC_PID,made-empty,made-persons text columns (output): sp_id,serialno,stcotrbg,hh_race,hh_income, hh_size,hh_age,latitude,longitude """ hh_columns = [4, 1, 3, 17, 17, 18, 17, 6, 5] aid.reorder_and_check_header(hh_csv, hh_columns, 'synth_households.txt-ca') # text columns (output): # sp_id,gq_type,persons,stcotrbg, # latitude,longitude gq_columns = [4, 17, 17, 3, 6, 5] aid.reorder_and_check_header(gq_csv, gq_columns, 'synth_gq.txt-ca')
def _save_pp_as_txt_with_reordering_columns(pp_csv, gq_pp_csv): """ csv columns (input): 0 SERIALNO,puma_id,place_id,SYNTHETIC_HID,longitude, 5 latitude,AGEGRP,HRSWRK,IMMSTAT,INCTAX, 10 MODE,OCC,POB,RELIGION,SEX, 15 SYNTHETIC_PID,made-sporder,made-empty,made-sex,made-age text columns (output): sp_id,sp_hh_id,serialno,stcotrbg,age, sex,race,sporder,relate,sp_school_id, sp_work_id """ pp_columns = [16, 4, 1, 3, 20, 19, 18, 17, 18, 18, 18] aid.reorder_and_check_header(pp_csv, pp_columns, 'synth_people.txt-ca') # text columns (output): # sp_id,sp_gq_id,sporder,age,sex gq_pp_columns = [16, 4, 17, 20, 19] aid.reorder_and_check_header(gq_pp_csv, gq_pp_columns, 'synth_gq_people.txt-ca')
def _save_hh_as_txt_with_reordering_columns(hh_csv, gq_csv): # csv columns (input): # 0 RT,TYPE,SERIALNO,puma_id,HINCP, # 5 NP,place_id,SYNTHETIC_HID,longitude,latitude, # 10 RT,puma_id,ST,SEX,AGEP, # 15 SCH,SCHG,RELP,HISP,ESR, # 20 PINCP,NATIVITY,OCCP,POBP,RAC1P, # 25 SYNTHETIC_PID,school_id,workplace_id,made-gq_type # text columns (output): # sp_id,serialno,stcotrbg,hh_race,hh_income, # hh_size,hh_age,latitude,longitude hh_columns = [8, 3, 7, 25, 5, 6, 15, 10, 9] aid.reorder_and_check_header(hh_csv, hh_columns, 'synth_households.txt-us') # text columns (output): # sp_id,gq_type,persons,stcotrbg,latitude,longitude gq_columns = [8, 29, 6, 7, 10, 9] aid.reorder_and_check_header(gq_csv, gq_columns, 'synth_gq.txt-us')
def _save_hh_as_txt_with_reordering_columns(hh_csv, gq_csv): """ csv columns (input): 0 COUNTRY,YEAR,SERIALNO,PERSONS,puma_id, 5 HHTYPE,PERNUM,place_id,SYNTHETIC_HID,longitude, 10 latitude,AGE,SEX,RACE,SCHOOL, 15 INCTOT,SYNTHETIC_PID+made-age,made-race,made-income, 20 made-empty text columns (output): sp_id,serialno,stcotrbg,hh_race,hh_income, hh_size,hh_age,latitude,longitude """ hh_columns = [9, 3, 8, 19, 20, 4, 18, 11, 10] aid.reorder_and_check_header(hh_csv, hh_columns, 'synth_households.txt-ipums') # text columns (output): # sp_id,gq_type,persons,stcotrbg,latitude,longitude gq_columns = [9, 21, 4, 8, 11, 10] aid.reorder_and_check_header(gq_csv, gq_columns, 'synth_gq.txt-ipums')
def _save_pp_as_txt_with_reordering_columns(pp_csv, gq_pp_csv): """ csv columns (input): 0 COUNTRY,YEAR,SERIALNO,PERSONS,puma_id, 5 HHTYPE,PERNUM,place_id,SYNTHETIC_HID,longitude, 10 latitude,AGE,SEX,RACE,SCHOOL, 15 INCTOT,SYNTHETIC_PID+made-sporder,made-age,made-empty, 20 made-race text columns (output): sp_id,sp_hh_id,serialno,stcotrbg,age, sex,race,sporder,relate,sp_school_id, sp_work_id """ pp_columns = [17, 9, 3, 8, 19, 13, 21, 18, 20, 20, 20] aid.reorder_and_check_header(pp_csv, pp_columns, 'synth_people.txt-ipums') # text columns (output): # sp_id,sp_gq_id,sporder,age,sex gq_pp_columns = [17, 9, 18, 19, 13] aid.reorder_and_check_header(gq_pp_csv, gq_pp_columns, 'synth_gq_people.txt-ipums')
def _save_pp_as_txt_with_reordering_columns(pp_csv, gq_pp_csv): # csv columns (input): # 0 RT,TYPE,SERIALNO,puma_id,HINCP, # 5 NP,place_id,SYNTHETIC_HID,longitude,latitude, # 10 RT,puma_id,ST,SEX,AGEP, # 15 SCH,SCHG,RELP,HISP,ESR, # 20 PINCP,NATIVITY,OCCP,POBP,RAC1P, # 25 SYNTHETIC_PID,school_id,workplace_id+made-sporder # text columns (output): # sp_id,sp_hh_id,serialno,stcotrbg,age, # sex,race,sporder,relate,sp_school_id, # sp_work_id pp_columns = [26, 8, 3, 7, 15, 14, 25, 29, 18, 27, 28] aid.reorder_and_check_header(pp_csv, pp_columns, 'synth_people.txt-us') # text columns (output): # sp_id,sp_gq_id,sporder,age,sex gp_columns = [26, 8, 29, 15, 14] aid.reorder_and_check_header(gq_pp_csv, gp_columns, 'synth_gq_people.txt-us')