Skip to content

Conversation

@corrinerojas
Copy link

No description provided.

for n in points:
lowest = 100
for x in points:
if euclidean_distance(n,x)!= 0 and euclidean_distance(n,x) < lowest:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the points are coincident (and valid)? You might have a distance of 0. You have two for loops, so you could check to see if the position (index) in the first for loop is the same as the index in the second. Check out enumerate to help do this.

@jlaura
Copy link
Contributor

jlaura commented Mar 1, 2016

👍

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

Successfully merging this pull request may close these issues.

2 participants