{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "27da604f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "import pandas as pd\n",
    "import geopandas as gpd\n",
    "\n",
    "# Read in the above json file\n",
    "nation = gpd.read_file(\"/Users/vims/Downloads/usa-high-1822-637b.json\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "7b7083fd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0        None\n",
       "1        None\n",
       "2        None\n",
       "3        None\n",
       "4        None\n",
       "         ... \n",
       "74129    None\n",
       "74130    None\n",
       "74131    None\n",
       "74132    None\n",
       "74133    None\n",
       "Name: FUDS_RAW, Length: 74134, dtype: object"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation[\"FUDS_RAW\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "117477e6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>GEOID10</th>\n",
       "      <th>SF</th>\n",
       "      <th>CF</th>\n",
       "      <th>HRS_ET</th>\n",
       "      <th>AML_ET</th>\n",
       "      <th>AML_RAW</th>\n",
       "      <th>FUDS_ET</th>\n",
       "      <th>FUDS_RAW</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>27139080202</td>\n",
       "      <td>Minnesota</td>\n",
       "      <td>Scott County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>27139080204</td>\n",
       "      <td>Minnesota</td>\n",
       "      <td>Scott County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>27139080100</td>\n",
       "      <td>Minnesota</td>\n",
       "      <td>Scott County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>27139080302</td>\n",
       "      <td>Minnesota</td>\n",
       "      <td>Scott County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>27139080400</td>\n",
       "      <td>Minnesota</td>\n",
       "      <td>Scott County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74129</th>\n",
       "      <td>16005001601</td>\n",
       "      <td>Idaho</td>\n",
       "      <td>Bannock County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74130</th>\n",
       "      <td>16005001300</td>\n",
       "      <td>Idaho</td>\n",
       "      <td>Bannock County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74131</th>\n",
       "      <td>16005001000</td>\n",
       "      <td>Idaho</td>\n",
       "      <td>Bannock County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74132</th>\n",
       "      <td>16005000900</td>\n",
       "      <td>Idaho</td>\n",
       "      <td>Bannock County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74133</th>\n",
       "      <td>16005000800</td>\n",
       "      <td>Idaho</td>\n",
       "      <td>Bannock County</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>74134 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           GEOID10         SF              CF HRS_ET  AML_ET AML_RAW  FUDS_ET  \\\n",
       "0      27139080202  Minnesota    Scott County   None   False    None    False   \n",
       "1      27139080204  Minnesota    Scott County   None   False    None    False   \n",
       "2      27139080100  Minnesota    Scott County   None   False    None    False   \n",
       "3      27139080302  Minnesota    Scott County   None   False    None    False   \n",
       "4      27139080400  Minnesota    Scott County   None   False    None    False   \n",
       "...            ...        ...             ...    ...     ...     ...      ...   \n",
       "74129  16005001601      Idaho  Bannock County   None   False    None    False   \n",
       "74130  16005001300      Idaho  Bannock County   None   False    None    False   \n",
       "74131  16005001000      Idaho  Bannock County   None   False    None    False   \n",
       "74132  16005000900      Idaho  Bannock County   None   False    None    False   \n",
       "74133  16005000800      Idaho  Bannock County   None   False    None    False   \n",
       "\n",
       "      FUDS_RAW  \n",
       "0         None  \n",
       "1         None  \n",
       "2         None  \n",
       "3         None  \n",
       "4         None  \n",
       "...        ...  \n",
       "74129     None  \n",
       "74130     None  \n",
       "74131     None  \n",
       "74132     None  \n",
       "74133     None  \n",
       "\n",
       "[74134 rows x 8 columns]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind = nation[\n",
    "    [\n",
    "        \"GEOID10\",\n",
    "        \"SF\",\n",
    "        \"CF\",\n",
    "        \"HRS_ET\",\n",
    "        \"AML_ET\",\n",
    "        \"AML_RAW\",\n",
    "        \"FUDS_ET\",\n",
    "        \"FUDS_RAW\",\n",
    "    ]\n",
    "]\n",
    "nation_new_ind"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "0f37acf4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([None, '0', '1'], dtype=object)"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"HRS_ET\"].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "4ae865ae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    8843\n",
       "1    4045\n",
       "Name: HRS_ET, dtype: int64"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"HRS_ET\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "2f0d29db",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False,  True])"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"AML_ET\"].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "646b3754",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False    72100\n",
       "True      2034\n",
       "Name: AML_ET, dtype: int64"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"AML_ET\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "0571df6d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([None, '1'], dtype=object)"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"AML_RAW\"].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "171fa3c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    2034\n",
       "Name: AML_RAW, dtype: int64"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"AML_RAW\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "370b0769",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False,  True])"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"FUDS_ET\"].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "f8afb668",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False    72056\n",
       "True      2078\n",
       "Name: FUDS_ET, dtype: int64"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"FUDS_ET\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "f2e3b78a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([None, '0', '1'], dtype=object)"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"FUDS_RAW\"].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "b722e802",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    3170\n",
       "1    2078\n",
       "Name: FUDS_RAW, dtype: int64"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nation_new_ind[\"FUDS_RAW\"].value_counts()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
