Skip to content

Commit

Permalink
Update members_geocoder.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik-Brown01 authored Jan 25, 2024
1 parent a99d742 commit 4fdf85d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/members_geocoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ def generate_members_info(AIRTABLE_API_KEY, AIRTABLE_APP_KEY, AIRTABLE_TBL_KEY,

if not cached_data.empty:
# If the address is in the cache, use the cached latitude and longitude
if cached_data.iloc[0]['lat'] != np.nan:
if !(np.isnan(cached_data.iloc[0]['lat'])):
member['lat'] = cached_data.iloc[0]['lat']
member['lon'] = cached_data.iloc[0]['lon'] # Assuming 'long' is the column name
member['Senate_District'] = cached_data.iloc[0]['Senate_District']
member['Assembly_District'] = cached_data.iloc[0]['Assembly_District']
member['County'] = cached_data.iloc[0]['County']
member['Zip_Code'] = cached_data.iloc[0]['Zip_Code']
print(f"Lat: {member['lat']} {member['lat'] != np.nan} | Lon: {member['lon']} | Senate_District: {member['Senate_District']} | Assembly_District: {member['Assembly_District']} | County: {member['County']} | Zip_Code: {member['Zip_Code']} (cached)")
print(f"Lat: {member['lat']} | Lon: {member['lon']} | Senate_District: {member['Senate_District']} | Assembly_District: {member['Assembly_District']} | County: {member['County']} | Zip_Code: {member['Zip_Code']} (cached)")

else:
member['lat'] = None
Expand Down

0 comments on commit 4fdf85d

Please sign in to comment.