> How do you sort distances to prepare for nearest neighbor when the results > returned look like this from the below statements?
It's unclear what you're asking. 1. Are you showing us the file content in the raw form: > Distance from 1 to > 16 is 43763.0757603 > 19 is 126516.988978 > 18 is 131011.694135 [text cut] and you're asking how to parse the content that you presented? 2. Or are you asking how to use the sort routines in Python? 3. Or are you asking how to write nearest neighbor? 4. Or are you asking for something else? I have no idea how to interpret what you mean by: DR=distance(n,XCOORDINATE, YCOORDINATE, IDCODE) DZ=switch(n,XCOORDINATE, YCOORDINATE, IDCODE) in your problem statement, given you don't say what DR, distance, switch, n, or IDCODE are. So I don't understand the terms being used in large portions of your problem statement. The question you're presenting has much more ambiguity than I'm comfortable with. Rather than try to cover all the bases, if you can scope the request to something more manageable, it'll probably make it easier to answer. Please clarify. Thanks! _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor