You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for a great article, i noticed an issue with the following code
i had to change this:
#add label in x,y position with the label as the film title
for i in range(len(df)):
ax.text(df.ix[i]['x'], df.ix[i]['y'], df.ix[i]['title'], size=8)
to this:
#add label in x,y position with the label as the film title
for i,r in df.iterrows():
ax.text(r['x'], r['y'], r['title'], size=8)
This is because earlier in the code, you set the dataframe index to the clusters: df = pd.DataFrame(dict(x=xs, y=ys, label=clusters, title=titles))
Thanks again
The text was updated successfully, but these errors were encountered:
Hi, thanks for a great article, i noticed an issue with the following code
i had to change this:
to this:
This is because earlier in the code, you set the dataframe index to the clusters:
df = pd.DataFrame(dict(x=xs, y=ys, label=clusters, title=titles))
Thanks again
The text was updated successfully, but these errors were encountered: