Python 请解释为什么我';我没有100%的时间得到一个值错误?
当我使用以下代码时,我有选择地查看地图或获取错误Python 请解释为什么我';我没有100%的时间得到一个值错误?,python,dataframe,Python,Dataframe,当我使用以下代码时,我有选择地查看地图或获取错误ValueError:无法插入群集标签,已经存在。有人能解释一下吗?此外,我使用了“标签”这个术语,这在某种程度上也起了作用。这里有些奇怪 # add clustering labels neighbourhoods_venues_sorted.insert(0, 'Cluster Labels', kmeans.labels_) toronto_merged = df_toronto # merge toronto_grouped with
ValueError:无法插入群集标签,已经存在。有人能解释一下吗?此外,我使用了“标签”这个术语,这在某种程度上也起了作用。这里有些奇怪
# 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!
你有电话吗?你是从哪里来的?你在插入什么?如果你用的是熊猫,请看一看