0

When I use the following code I selectively see a map or get the error ValueError: cannot insert Cluster Labels, already exists. Could someone please explain? Additionally, I used the term "lable" and that worked somewhat too. Something is odd here.

# add clustering labels
neighbourhoods_venues_sorted.insert(0, 'Cluster Labels', kmeans.labels_)

toronto_merged = df_toronto

# merge toronto_grouped with toronto_data to add latitude/longitude for each neighborhood
toronto_merged = toronto_merged.join(neighborhoods_venues_sorted.set_index('Neighbourhood'), on='Neighbourhood')

toronto_merged.head() # check the last columns!
martineau
  • 119,623
  • 25
  • 170
  • 301
  • 2
    Do you have a [mcve]? – AMC Jan 16 '20 at 17:22
  • 1
    What are you inserting from? What are you inserting into? If you're using pandas, please have a look at [How to make good pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) – G. Anderson Jan 16 '20 at 17:30
  • https://dataplatform.cloud.ibm.com/analytics/notebooks/v2/dd1223c0-0f64-48e5-b682-bc05c0b9777a/view?access_token=be5a2624be34d810b2c23d27d328024ab1b5bf6a94065cbecbab976d46c394ab – Nikhila Nandgopal Jan 16 '20 at 17:53

0 Answers0