Skip to content

Instantly share code, notes, and snippets.

@ShayanRiyaz
Created April 24, 2020 10:34
Show Gist options
  • Save ShayanRiyaz/f311307236b8c69556c8315abd96b08f to your computer and use it in GitHub Desktop.
Save ShayanRiyaz/f311307236b8c69556c8315abd96b08f to your computer and use it in GitHub Desktop.
clus1neigh=la_merged.loc[la_merged['Cluster Label'] == 1, la_merged.columns[0]].values.tolist()
filtered_nhoods=nhoods.copy()
for i in range(0,len(filtered_nhoods)):
if filtered_nhoods.iloc[i,0] not in clus1neigh:
filtered_nhoods.iloc[i,0]='TO DROP'
filtered_nhoods=filtered_nhoods[filtered_nhoods.Neighbourhood!='TO DROP']
filtered_nhoods.reset_index(drop=True,inplace=True)
filtered_nhoods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment