Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33602 > unrolled thread

Re: Error

Started byinshu chauhan <insideshoes@gmail.com>
First post2012-11-20 13:31 +0100
Last post2012-11-20 13:31 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Error inshu chauhan <insideshoes@gmail.com> - 2012-11-20 13:31 +0100

#33602 — Re: Error

Frominshu chauhan <insideshoes@gmail.com>
Date2012-11-20 13:31 +0100
SubjectRe: Error
Message-ID<mailman.43.1353414710.29569.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

I did the following changes in this part of my programme.. now the
refereence error is removed but its showing me another error :

def ComputeClasses(data):
    radius = .5
    points = []
    for cy in xrange(0, data.height):
        for cx in xrange(0, data.width):

            if data[cy,cx] == (0.0,0.0,0.0):
                continue
            else :
                centre = data[cy, cx]
                print centre
                points.append(centre)


            change = True

            while change:

                for ring_number in xrange(1, 1000):
                    change = False
                    new_indices = GenerateRing(cx, cy, ring_number)

                    for idx in new_indices:
                        point = data[idx[0], idx[1]]

                        if point == (0.0, 0.0, 0.0 ):
                          continue
                        else:

                            dist = distance(centre, point)
                            if  dist < radius :
                                print point
                                points.append(point)
                                change = True
                                print change


                break


            print points


ERROR :

Traceback (most recent call last):
  File "Z:/modules/classification1.py", line 71, in <module>
    ComputeClasses(data)
  File "Z:/modules/classification1.py", line 47, in ComputeClasses
    point = data[idx[0], idx[1]]
error: index is out of range

What is meant by this statement ' Index out of range ' ? Does it mean that
my range 1, 1000 is exceeded ??

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web