【发布时间】:2022-01-25 17:42:23
【问题描述】:
我正在做以下手册:https://towardsdatascience.com/mapping-geograph-data-in-python-610a963d2d7f
我从这段代码中收到以下错误:
# Plot Comuna
comuna = 'SANTIAGO'
com_id = df[df.NOM_COMUNA == comuna].index.get_values()[0]
plot_shape(com_id, comuna)
错误
AttributeError: 'Int64Index' 对象没有属性 'get_values'
【问题讨论】:
-
只是
df['tableName'].valuesdf['tableName'].index获取所有索引,而不是给定索引的值
标签: python pandas jupyter-notebook data-science