cenpy.products.ACS.from_msa¶
-
ACS.
from_msa
(self, msa, variables=None, level='tract', **kwargs)[source]¶ Query the Census for the given MSA.
- MSAstr
description of the MSA. Should be of the form “MSA, state” or “MSA”
- MSA_typestr
type of MSA 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_MSA 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 MSAs 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 MSA.
- return_boundsbool
whether to return the boundary of the MSA being queried. (default: False)
- reMSA_missingbool
whether to reMSA 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 MSA_type. There is a significant amount of vagueness in what is meant by “MSA” that you may not get the match you intend if you do not provide a MSA_type.