reVX.utilities.reeds_cols.add_county_info

add_county_info(data_frame, regions='https://www2.census.gov/geo/tiger/TIGER2021/COUNTY/tl_2021_us_county.zip')[source]

Add county info to a Pandas DataFrame with coordinates.

The input DataFrame must have latitude and longitude columns.

Parameters:
  • data_frame (pandas.DataFrame) – A pandas data frame with latitude and longitude coordinates.

  • regions (str | GeoDataFrame) – Path to regions shapefile containing labeled geometries or a pre-loaded GeoDataFrame.

Returns:

pandas.DataFrame – A pandas data frame with all initial input data plus three new columns: “cnty_fips”, “state”, and “county”. “cnty_fips” is a five-digit county code, while “state” and “county” are the state and county names, respectively.