In [1]:
import seaborn as sns
import metapack as mp
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display 

%matplotlib inline
sns.set_context('notebook')

In [2]:
#pkg = mp.jupyter.open_package()
pkg = mp.jupyter.open_source_package()
pkg


Out[2]:

San Diego PUMS

census.gov-pums-20165-1 Last Update: 2018-11-29T05:13:44

PUMS Housing and personal records for San Diego county.

Documentation Links

Contacts

References


In [3]:
pums = pkg.reference('sd_pums').dataframe()
sdc_pums = list(pums[pums.GEOID10.astype('str').str.startswith('6073')].PUMACE10)

In [4]:
df = pkg.reference('pums_ca_pop').dataframe()

In [5]:
# Get the records that are in San Diego county0
df_sd_pop=df[df.PUMA.isin(sdc_pums)]
len(df_sd_pop)


Out[5]:
145525

In [6]:
df = pkg.reference('pums_ca_house').dataframe()

In [7]:
# Get the records that are in San Diego county
df_sd_house=df[df.PUMA.isin(sdc_pums)]
len(df_sd_house)


Out[7]:
62308