diff --git a/.github/workflows/provider-map-jobs.yml b/.github/workflows/provider-map-jobs.yml index e84e26d0..c5d771be 100644 --- a/.github/workflows/provider-map-jobs.yml +++ b/.github/workflows/provider-map-jobs.yml @@ -54,10 +54,27 @@ jobs: import json import pandas as pd - df = pd.read_csv('src/metadata/providers/providers.csv') + providers_file = 'src/metadata/providers/providers.csv' - # Drop the null values for TAs that don't have counties served - df = df[df['counties_served'].notnull()] + df = pd.read_csv(providers_file') + city_lookup = pd.read_csv('src/metadata/cities_to_county.csv') + city_to_county = dict(zip(city_lookup['City'], city_lookup['County'])) + + lookup_records = df[df['counties_served'].isna()]['ntd_id'] + + # Fill in the null values for counties served with the HQ county + for record in lookup_records: + city = df[df['ntd_id'] == record]['hq_city'].values[0] + + try: + county = city_to_county[city] or city_to_county[f'City of {city}'] + df.loc[df['ntd_id'] == record, 'hq_county'] = county + df.loc[df['ntd_id'] == record, 'counties_served'] = county + + except KeyError: + print("No county found for city: ", city) + + df.to_csv(providers_file) # Do a group by for the counties served county_counts = df['counties_served'].str.split(';') \ diff --git a/src/metadata/cities_to_county.csv b/src/metadata/cities_to_county.csv new file mode 100644 index 00000000..1c224f15 --- /dev/null +++ b/src/metadata/cities_to_county.csv @@ -0,0 +1,456 @@ +County,City +San Bernardino,Adelanto +Los Angeles,Agoura Hills +Alameda,Alameda +Alameda,Albany +Los Angeles,Alhambra +Modoc,Alturas +Amador,Amador City +Orange,Anaheim +Shasta,Anderson +Calaveras,Angels +Contra Costa,Antioch +San Bernardino,Apple Valley +Los Angeles,Arcadia +Humboldt,Arcata +San Luis Obispo,Arroyo Grande +Los Angeles,Artesia +Kern,Arvin +San Luis Obispo,Atascadero +San Mateo,Atherton +Merced,Atwater +Placer,Auburn +Los Angeles,Avalon +Kings,Avenal +Los Angeles,Azusa +Kern,Bakersfield +Los Angeles,Baldwin Park +Riverside,Banning +San Bernardino,Barstow +Riverside,Beaumont +Los Angeles,Bell +Los Angeles,Bell Gardens +Los Angeles,Bellflower +San Mateo,Belmont +Marin,Belvedere +Solano,Benicia +Alameda,Berkeley +Los Angeles,Beverly Hills +San Bernardino,Big Bear Lake +Butte,Biggs +Inyo,Bishop +Humboldt,Blue Lake +Riverside,Blythe +Los Angeles,Bradbury +Imperial,Brawley +Orange,Brea +Contra Costa,Brentwood +San Mateo,Brisbane +Orange,Buena Park +Los Angeles,Burbank +San Mateo,Burlingame +Imperial,Calexico +Kern,California City +Imperial,Calipatria +Napa,Calistoga +Ventura,Camarillo +Santa Clara,Campbell +Santa Cruz,Capitola +San Diego,Carlsbad +Monterey,Carmel-By-The-Sea +Santa Barbara,Carpinteria +Los Angeles,Carson +Riverside,Cathedral City +Stanislaus,Ceres +Los Angeles,Cerritos +Butte,Chico +San Bernardino,Chino +Madera,Chowchilla +San Diego,Chula Vista +Los Angeles,Claremont +Contra Costa,Clayton +Sonoma,Cloverdale +Fresno,Clovis +Riverside,Coachella +Fresno,Coalinga +Placer,Colfax +San Mateo,Colma +San Bernardino,Colton +Colusa,Colusa +Los Angeles,Commerce +Los Angeles,Compton +Contra Costa,Concord +Kings,Corcoran +Tehama,Corning +Riverside,Corona +San Diego,Coronado +Marin,Corte Madera +Orange,Costa Mesa +Sonoma,Cotati +Los Angeles,Covina +Del Norte,Crescent City +Los Angeles,Cudahy +Los Angeles,Culver City +Santa Clara,Cupertino +Orange,Cypress +San Mateo,Daly City +Orange,Dana Point +Contra Costa,Danville +Yolo,Davis +San Diego,Del Mar +Monterey,Del Rey Oaks +Kern,Delano +Riverside,Desert Hot Springs +Los Angeles,Diamond Bar +Tulare,Dinuba +Solano,Dixon +Siskiyou,Dorris +Merced,Dos Palos +Los Angeles,Downey +Los Angeles,Duarte +Alameda,Dublin +Siskiyou,Dunsmuir +San Mateo,East Palo Alto +San Diego,El Cajon +Imperial,El Centro +Contra Costa,El Cerrito +Los Angeles,El Monte +Los Angeles,El Segundo +Alameda,Emeryville +San Diego,Encinitas +San Joaquin,Escalon +San Diego,Escondido +Siskiyou,Etna +Humboldt,Eureka +Tulare,Exeter +Marin,Fairfax +Solano,Fairfield +Tulare,Farmersville +Humboldt,Ferndale +Ventura,Fillmore +Fresno,Firebaugh +Sacramento,Folsom +San Bernardino,Fontana +Mendocino,Fort Bragg +Siskiyou,Fort Jones +Humboldt,Fortuna +San Mateo,Foster City +Orange,Fountain Valley +Fresno,Fowler +Alameda,Fremont +Fresno,Fresno +Orange,Fullerton +Sacramento,Galt +Orange,Garden Grove +Los Angeles,Gardena +Santa Clara,Gilroy +Los Angeles,Glendale +Los Angeles,Glendora +Monterey,Gonzales +San Bernardino,Grand Terrace +Nevada,Grass Valley +Monterey,Greenfield +Butte,Gridley +San Luis Obispo,Grover Beach +Santa Barbara,Guadalupe +Merced,Gustine +San Mateo,Half Moon Bay +Kings,Hanford +Los Angeles,Hawaiian Gardens +Los Angeles,Hawthorne +Alameda,Hayward +Sonoma,Healdsburg +Riverside,Hemet +Contra Costa,Hercules +Los Angeles,Hermosa Beach +San Bernardino,Hesperia +Los Angeles,Hidden Hills +San Bernardino,Highland +San Mateo,Hillsborough +San Benito,Hollister +Imperial,Holtville +Stanislaus,Hughson +Orange,Huntington Beach +Los Angeles,Huntington Park +Fresno,Huron +Imperial,Imperial +San Diego,Imperial Beach +Riverside,Indian Wells +Riverside,Indio +Los Angeles,Industry +Los Angeles,Inglewood +Amador,Ione +Orange,Irvine +Los Angeles,Irwindale +Sacramento,Isleton +Amador,Jackson +Fresno,Kerman +Monterey,King City +Fresno,Kingsburg +Los Angeles,La Cañada Flintridge +Orange,La Habra +Los Angeles,La Habra Heights +San Diego,La Mesa +Los Angeles,La Mirada +Orange,La Palma +Los Angeles,La Puente +Riverside,La Quinta +Los Angeles,La Verne +Contra Costa,Lafayette +Orange,Laguna Beach +Orange,Laguna Niguel +Riverside,Lake Elsinore +Lake,Lakeport +Los Angeles,Lakewood +Los Angeles,Lancaster +Marin,Larkspur +San Joaquin,Lathrop +Los Angeles,Lawndale +San Diego,Lemon Grove +Kings,Lemoore +Placer,Lincoln +Tulare,Lindsay +Sutter,Live Oak +Alameda,Livermore +Merced,Livingston +San Joaquin,Lodi +San Bernardino,Loma Linda +Los Angeles,Lomita +Santa Barbara,Lompoc +Los Angeles,Long Beach +Placer,Loomis +Orange,Los Alamitos +Santa Clara,Los Altos +Santa Clara,Los Altos Hills +Los Angeles,Los Angeles +Merced,Los Banos +Santa Clara,Los Gatos +Sierra,Loyalton +Los Angeles,Lynwood +Madera,Madera +Mono,Mammoth Lakes +Los Angeles,Manhattan Beach +San Joaquin,Manteca +Kern,Maricopa +Monterey,Marina +Contra Costa,Martinez +Yuba,Marysville +Los Angeles,Maywood +Kern,McFarland +Fresno,Mendota +San Mateo,Menlo Park +Merced,Merced +Marin,Mill Valley +San Mateo,Millbrae +Santa Clara,Milpitas +Orange,Mission Viejo +Stanislaus,Modesto +Los Angeles,Monrovia +Siskiyou,Montague +San Bernardino,Montclair +Santa Clara,Monte Sereno +Los Angeles,Montebello +Monterey,Monterey +Los Angeles,Monterey Park +Ventura,Moorpark +Contra Costa,Moraga +Riverside,Moreno Valley +Santa Clara,Morgan Hill +San Luis Obispo,Morro Bay +Siskiyou,Mount Shasta +Santa Clara,Mountain View +Napa,Napa +San Diego,National City +San Bernardino,Needles +Nevada,Nevada City +Alameda,Newark +Stanislaus,Newman +Orange,Newport Beach +Riverside,Norco +Los Angeles,Norwalk +Marin,Novato +Stanislaus,Oakdale +Alameda,Oakland +San Diego,Oceanside +Ventura,Ojai +San Bernardino,Ontario +Orange,Orange +Fresno,Orange Cove +Contra Costa,Orinda +Glenn,Orland +Butte,Oroville +Ventura,Oxnard +Monterey,Pacific Grove +San Mateo,Pacifica +Riverside,Palm Desert +Riverside,Palm Springs +Los Angeles,Palmdale +Santa Clara,Palo Alto +Los Angeles,Palos Verdes Estates +Butte,Paradise +Los Angeles,Paramount +Fresno,Parlier +Los Angeles,Pasadena +San Luis Obispo,Paso Robles +Stanislaus,Patterson +Riverside,Perris +Sonoma,Petaluma +Los Angeles,Pico Rivera +Alameda,Piedmont +Contra Costa,Pinole +San Luis Obispo,Pismo Beach +Contra Costa,Pittsburg +Orange,Placentia +El Dorado,Placerville +Contra Costa,Pleasant Hill +Alameda,Pleasanton +Amador,Plymouth +Mendocino,Point Arena +Los Angeles,Pomona +Ventura,Port Hueneme +Tulare,Porterville +Plumas,Portola +San Mateo,Portola Valley +San Diego,Poway +San Bernardino,Rancho Cucamonga +Riverside,Rancho Mirage +Los Angeles,Rancho Palos Verdes +Tehama,Red Bluff +Shasta,Redding +San Bernardino,Redlands +Los Angeles,Redondo Beach +San Mateo,Redwood City +Fresno,Reedley +San Bernardino,Rialto +Contra Costa,Richmond +Kern,Ridgecrest +Humboldt,Rio Dell +Solano,Rio Vista +San Joaquin,Ripon +Stanislaus,Riverbank +Riverside,Riverside +Placer,Rocklin +Sonoma,Rohnert Park +Los Angeles,Rolling Hills +Los Angeles,Rolling Hills Estates +Los Angeles,Rosemead +Placer,Roseville +Marin,Ross +Sacramento,Sacramento +Monterey,Salinas +Marin,San Anselmo +San Bernardino,San Bernardino +San Mateo,San Bruno +San Mateo,San Carlos +Orange,San Clemente +San Diego,San Diego +Los Angeles,San Dimas +Los Angeles,San Fernando +San Francisco,San Francisco +Los Angeles,San Gabriel +Riverside,San Jacinto +Fresno,San Joaquin +Santa Clara,San Jose +San Benito,San Juan Bautista +Orange,San Juan Capistrano +Alameda,San Leandro +San Luis Obispo,San Luis Obispo +San Diego,San Marcos +Los Angeles,San Marino +San Mateo,San Mateo +Contra Costa,San Pablo +Marin,San Rafael +Contra Costa,San Ramon +Monterey,Sand City +Fresno,Sanger +Orange,Santa Ana +Santa Barbara,Santa Barbara +Santa Clara,Santa Clara +Los Angeles,Santa Clarita +Santa Cruz,Santa Cruz +Los Angeles,Santa Fe Springs +Santa Barbara,Santa Maria +Los Angeles,Santa Monica +Ventura,Santa Paula +Sonoma,Santa Rosa +San Diego,Santee +Santa Clara,Saratoga +Marin,Sausalito +Santa Cruz,Scotts Valley +Orange,Seal Beach +Monterey,Seaside +Sonoma,Sebastopol +Fresno,Selma +Kern,Shafter +Los Angeles,Sierra Madre +Los Angeles,Signal Hill +Ventura,Simi Valley +San Diego,Solana Beach +Monterey,Soledad +Santa Barbara,Solvang +Sonoma,Sonoma +Tuolumne,Sonora +Los Angeles,South El Monte +Los Angeles,South Gate +El Dorado,South Lake Tahoe +Los Angeles,South Pasadena +San Mateo,South San Francisco +Napa,St. Helena +Orange,Stanton +San Joaquin,Stockton +Solano,Suisun City +Santa Clara,Sunnyvale +Lassen,Susanville +Amador,Sutter Creek +Kern,Taft +Kern,Tehachapi +Tehama,Tehama +Riverside,Temecula +Los Angeles,Temple City +Ventura,Thousand Oaks +Marin,Tiburon +Los Angeles,Torrance +San Joaquin,Tracy +Humboldt,Trinidad +Tulare,Tulare +Siskiyou,Tulelake +Stanislaus,Turlock +Orange,Tustin +San Bernardino,Twentynine Palms +Mendocino,Ukiah +Alameda,Union City +San Bernardino,Upland +Solano,Vacaville +Solano,Vallejo +Ventura,Ventura +Los Angeles,Vernon +San Bernardino,Victorville +Orange,Villa Park +Tulare,Visalia +San Diego,Vista +Los Angeles,Walnut +Contra Costa,Walnut Creek +Kern,Wasco +Stanislaus,Waterford +Santa Cruz,Watsonville +Siskiyou,Weed +Los Angeles,West Covina +Los Angeles,West Hollywood +Yolo,West Sacramento +Los Angeles,Westlake Village +Orange,Westminster +Imperial,Westmorland +Yuba,Wheatland +Los Angeles,Whittier +Colusa,Williams +Mendocino,Willits +Glenn,Willows +Yolo,Winters +Tulare,Woodlake +Yolo,Woodland +San Mateo,Woodside +Orange,Yorba Linda +Napa,Yountville +Siskiyou,Yreka +Sutter,Yuba City +San Bernardino,Yucaipa