Last active
August 5, 2021 09:06
-
-
Save liannewriting/65710f273e9eae93bb05b3328eab32f7 to your computer and use it in GitHub Desktop.
data_cleaning_202001
This file contains 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
df_add_ex['address_std'] = df_add_ex['address'].str.lower() | |
df_add_ex['address_std'] = df_add_ex['address_std'].str.strip() # remove leading and trailing whitespace. | |
df_add_ex['address_std'] = df_add_ex['address_std'].str.replace('\\.', '') # remove period. | |
df_add_ex['address_std'] = df_add_ex['address_std'].str.replace('\\bstreet\\b', 'st') # replace street with st. | |
df_add_ex['address_std'] = df_add_ex['address_std'].str.replace('\\bapartment\\b', 'apt') # replace apartment with apt. | |
df_add_ex['address_std'] = df_add_ex['address_std'].str.replace('\\bav\\b', 'ave') # replace apartment with apt. | |
df_add_ex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment