Index Error
inshu chauhan
insideshoes at gmail.com
Tue Nov 20 08:57:29 EST 2012
I am using python 2.7.3 , so can it be done in that ?
On Tue, Nov 20, 2012 at 2:48 PM, Chris Angelico <rosuav at gmail.com> wrote:
> On Wed, Nov 21, 2012 at 12:43 AM, inshu chauhan <insideshoes at gmail.com>
> wrote:
> > I need help in this part as I am unable to device a method in which if
> the
> > points are out of index,it should stop.....
> >
> > Traceback (most recent call last):
> > File "Z:/modules/Classify.py", line 73, in <module>
> > ComputeClasses(data)
> > File "Z:/modules/Classify.py", line 49, in ComputeClasses
> > point = data[idx[0], idx[1]]
> > error: index is out of range
> >
>
> When Python throws an exception, you can catch it and handle it as you
> please. In this instance, it seems to me you want to break out of one
> loop (if I've read your comments correctly), so just bracket that loop
> with try... except. Start here:
>
> http://docs.python.org/3.3/tutorial/errors.html
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121120/59bec721/attachment.html>
More information about the Python-list
mailing list