Skip to content

Instantly share code, notes, and snippets.

@ShayanRiyaz
Created April 24, 2020 10:29
Show Gist options
  • Save ShayanRiyaz/e6c4aad4e37fd9741630c7d2a852c171 to your computer and use it in GitHub Desktop.
Save ShayanRiyaz/e6c4aad4e37fd9741630c7d2a852c171 to your computer and use it in GitHub Desktop.
df['Neighbourhood'] = df.Neighbourhood.str.partition('[')[0] #Removes the citation and reference brackets
df['Neighbourhood'] = df.Neighbourhood.str.partition(',')[0] #Removes the alternatives for 'Bel Air'
df=df[df.Neighbourhood!='Baldwin Hills/Crenshaw'] #Removes redundancy as 'Baldwin Hills' and 'Crenshaw' exist already
df=df[df.Neighbourhood!='Hollywood Hills West'] #Removes redundancy as it has the same coordinates as 'Hollywood Hills'
df=df[df.Neighbourhood!='Brentwood Circle'] #Removes redundancy as it has the same coordinates as 'Brentwood'
df=df[df.Neighbourhood!='Wilshire Park'] #Removes redundancy as it has the same coordinates as 'Wilshire Center'
df.reset_index(inplace=True,drop=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment