cenpy.products.ACS.from_county¶
-
ACS.
from_county
(self, county, variables=None, level='tract', **kwargs)[source]¶ Query the Census for the given county.
- countystr
description of the county. Should be of the form “county, state” or “county”
- county_typestr
type of county to focus on, Incorporated Place, County Subdivision, or Census Designated Place.
- variableslist or str
variable or set of variables to extract from the API. Can include regex columns, which will match to any column in the product. So, [‘P001001’, ‘^P002’] will match to P001001 and any column that starts with P002.
- levelstr (default: ‘tract’)
level at which to extract the geographic data. May be limited by some products to only involve tracts. (default: ‘tract’)
- return_geometrybool
whether to return the geometries of the queried records. True by default, this will ensure that the return type of from_county is a geopandas.GeoDataFrame. If False, then only the records are fetched; none of the records’ geometries are requested from the server. (default: True)
- geometry_precisionint
number of decimal countys to preserve when getting the geometric information around each observation in level. (default: 2)
- strict_withinbool
whether to retain only geometries that are fully within the target county.
- return_boundsbool
whether to return the boundary of the county being queried. (default: False)
- recounty_missingbool
whether to recounty missing values in the data with numpy.nan, according to the standard missing values used by the ACS. (default: True)
Notes
You should always try to provide a county_type. There is a significant amount of vagueness in what is meant by “county” that you may not get the match you intend if you do not provide a county_type.