<jupyter_start><jupyter_text>Support GeoidsThis notebook is created to generate the 2010_to_2020 support geoid table used by labs [read code here](https://github.com/NYCPlanning/labs-factfinder/blob/5a85aa791d719839c3073bae511b79e0ca220276/app/queries/geography-options.js)<jupyter_code>from factfinder.calculate import Calculate
from dotenv import load_dotenv
import pandas as pd

try:
    env_path = "../.env"
    load_dotenv(dotenv_path=env_path)
except:
    print(".env file is missing ...")

calculate = Calculate(api_key=os.environ["API_KEY"], year=2019, source="acs", geography='2010_to_2020')


df = calculate.geo.lookup_geo
df.head()
nta = df.loc[:,['nta', 'nta_name']]\
        .drop_duplicates()\
        .rename(columns={'nta':'geoid', 'nta_name': 'geogname'})\
        .assign(geotype='NTA2020')
nta
cdta = df.loc[:,['cdta', 'cdta_name']]\
        .drop_duplicates()\
        .rename(columns={'cdta':'geoid', 'cdta_name': 'geogname'})\
        .assign(geotype='CDTA2020')
cdta
boro = df.loc[:,['borocode', 'boro']]\
        .drop_duplicates()\
        .rename(columns={'borocode':'geoid', 'boro': 'geogname'})\
        .assign(geotype='Boro2020')
boro
city = pd.DataFrame([{'geoid': '0', 'geogname': 'New York City', 'geotype': 'City2020'}])
city
support_geoids = pd.concat([nta, cdta, boro, city])
support_geoids<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17256637168141592, 'fraction_numerical': 0.04793510324483776, 'mean_word_length': 4.774468085106383, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '175540', 'license': 'MIT', 'n_tokens_mistral': 553, 'n_tokens_neox': 504, 'n_words': 89, 'path': 'notebooks/support_geoids.ipynb', 'repo_name': 'NYCPlanning/db-factfinder', 'size': '1356'}