Created
September 23, 2021 18:03
-
-
Save andrewdoss-bit/6229c8bee56efb2b1153d789c9fe3eb5 to your computer and use it in GitHub Desktop.
FIPS Cleaner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fips_cleaner(code): | |
"""Standardizes county FIPS codes as 5-digit strings.""" | |
return code.astype(str).str.extract('(^[^/.]*).*', expand=False).str.zfill(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment