def CA_LATITUDE(county_CODE): if county_CODE == 4710: return 41.5188 else: return np.nan CA_LOCATION['LATITUDE'] = CA_LOCATION['LATITUDE'].fillna(CA_LOCATION.CNTY_CITY_LOC.apply(CA_LATITUDE))