# Creating example bls maps
from bls_geo import *
# can check out https://www.bls.gov/oes/current/oes_stru.htm
bio = '172031'
bio_stats = oes_geo(bio)
areas = get_areas() # this takes a few minutes
state = state_albers()
geo_bio = merge_occgeo(bio_stats,areas)
ax = geo_bio.plot(column='Employment',cmap='inferno',legend=True,zorder=2)
state.boundary.plot(ax=ax,color='grey',linewidth=0.5,zorder=1)
ax.set_ylim(0.1*1e6,3.3*1e6)
ax.set_xlim(-0.3*1e7,0.3*1e7) # lower 48 focus (for Albers proj)
ax.set_axis_off()
plt.show()
# Can export to excel (csv parsing is tough, maybe use tsv instead)
bio_stats.to_excel('biojobs.xlsx')
att = ['areaName','Employment','Location Quotient','Employment per 1,000 jobs','Annual mean wage']
form = ['',',.0f','.2f','.2f',',.0f']
map_bio = fol_map(geo_bio,'Employment',['lat', 'lon'],att,form)
#map_bio.save('biomap.html')
map_bio
# Data science jobs
ds = '152098'
ds_stats = oes_geo(ds)
geo_ds = merge_occgeo(ds_stats,areas)
geo_ds.sort_values(by='Employment',inplace=True,ascending=False)
lim_fields = ['areaName','Employment','Annual mean wage','Annual 75th percentile wage']
geo_ds[lim_fields].head(10)
map_ds = fol_map(geo_ds,'Annual 75th percentile wage',['lat', 'lon'],att,form)
map_ds