Ecologists use Shannon entropy to measure species diversity in a given region. Here I apply the same equation to determine industry diversity in each US county. In the map below, darker color indicates greater industrial diversity:
Downloaded the 2009 County Business Patterns data from the US Census Bureau and extracted the business establishment counts for each six-digit NAICS code for each county. Then, for each county, I computed the Shannon entropy from the establishment counts in each NAICS code. Finally, I partitioned the entropy values into nine distinct colors to fill in the map above.
Code implementing the above-described computations is available on the Badass Data Science wiki.
I used the Python mapping method detailed here.