def _data_fetch(): # df = acs(['B24092_004E', 'B24092_013E']) # todo: test this against what I'm seeing in kauffman_indicators # df = qwi(indicator_lst=['Emp', 'HirA'], obs_level='us', annualize=None, strata=['sex', 'industry']) df = qwi(obs_level='msa', state_list=['CO', 'UT'], strata=['firmsize']) df = qwi(obs_level='state') df = qwi(obs_level='msa') df = qwi(obs_level='county') # df = bed('firm size', 1) # df = bed('firm size', 2) # df = bed('firm size', 3) # df = bed('firm size', 4) # df = bed('1bf', obs_level=['AL', 'US', 'MO']) # df = bfs(['BA_BA', 'BF_SBF8Q'], obs_level=['AZ']) # df = bfs(['BA_BA', 'BF_SBF8Q'], obs_level='state') # df = bfs(['BA_BA', 'BF_SBF8Q', 'BF_DUR8Q'], obs_level=['AZ'], annualize=True) # df = bfs(['BA_BA', 'BF_SBF8Q', 'BF_DUR8Q'], obs_level=['US', 'AK'], march_shift=True) # df = bds(['FIRM', 'ESTAB'], obs_level='all') # df = pep(obs_level='us') # df = pep(obs_level='state') df = pep(obs_level='msa') # df = pep(obs_level='county') print(df.head()) print(df.tail()) print(df.info())
def mpj_data_fetch(): ## setting private=False results in zero rows returned # qwi(['EarnBeg'], obs_level='us', private=True, annualize=True) \ # [['time', 'EarnBeg']]. \ # rename(columns={'EarnBeg': 'EarnBeg_us'}). \ # apply(pd.to_numeric). \ # to_csv(c.filenamer('../tests/data/earnbeg_us.csv'), index=False) # for region in ['us', 'state', 'msa', 'county']: for region in ['us', 'state']: qwi(['Emp', 'EmpEnd', 'EarnBeg', 'EmpS', 'EmpTotal', 'FrmJbC'], obs_level=region, private=True, strata=['firmage', 'industry'], annualize=True).\ to_csv(c.filenamer(f'../tests/data/qwi_{region}.csv'), index=False) pep(region).\ rename(columns={'POP': 'population'}). \ to_csv(c.filenamer(f'../tests/data/pep_{region}.csv'), index=False)
def qwi_test(): # strata, msa df = qwi(['Emp', 'EmpEnd', 'EarnBeg', 'EmpS', 'EmpTotal', 'FrmJbC'], obs_level='msa', state_list=['06'], private=True, strata=['firmage'], annualize=True) print(df)
def county_msa_cw(): df = qwi(['Emp'], obs_level='county', state_list=['MO'], annualize=False).\ pipe(county_msa_cross_walk, 'fips') print(df.head(10))
def _etl_tests(): df = qwi(['Emp'], obs_level='county', annualize=False).\ pipe(county_msa_cross_walk, 'fips') print(df.head(10))