I am using python 2.7.3 , so can it be done in that ?<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 20, 2012 at 2:48 PM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Nov 21, 2012 at 12:43 AM, inshu chauhan <<a href="mailto:insideshoes@gmail.com">insideshoes@gmail.com</a>> wrote:<br>

> I need help in this part as I am unable to device a method in which if the<br>
</div>> points are out of index,it should stop.....<br>
<div class="im">><br>
> Traceback (most recent call last):<br>
>   File "Z:/modules/Classify.py", line 73, in <module><br>
>     ComputeClasses(data)<br>
>   File "Z:/modules/Classify.py", line 49, in ComputeClasses<br>
>     point = data[idx[0], idx[1]]<br>
> error: index is out of range<br>
><br>
<br>
</div>When Python throws an exception, you can catch it and handle it as you<br>
please. In this instance, it seems to me you want to break out of one<br>
loop (if I've read your comments correctly), so just bracket that loop<br>
with try... except. Start here:<br>
<br>
<a href="http://docs.python.org/3.3/tutorial/errors.html" target="_blank">http://docs.python.org/3.3/tutorial/errors.html</a><br>
<br>
ChrisA<br>
<span class="HOEnZb"><font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br></div>