Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in the visualisation section when iterating through the dataframe #8

Open
attibalazs opened this issue Jun 22, 2016 · 0 comments

Comments

@attibalazs
Copy link

attibalazs commented Jun 22, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant