paul taney wrote:
> If you"d rather I take this question to the numpy list, I 
> understand, but I am learning FloatCanvas simultaniously :-)
> And numpy is a bit over my head -- as I am studying the 
> 380 page doc.

well, I suggest you extract just the numpy part and ask about it on the 
numpy list. The code you posted was a fine start, where you had a 
literal to initialize your array with for testing.

> # > which will clean up your later code: # CB
> # >         for x in range(x1, x2):      # paul
> # >             for y in range(y1, y2):
> # >                 i = (y * w + x) * 3  # stride  Smart page 285
> # >                 red, grn, blu = d[i], d[i+1], d[i+2] 
> 
> # > this could then be:  [IT COMPILES TO HERE]
> #red, grn, blu = d[x,y]  # returns NameError: name 'x' is not defined

that's because x and y are only defined if you have the for loops...

> red, grn, blu = d[:,:]   # so paul tries an xy slice,  
> #    gets IndexError: too many indices

too many? it should be too few -- odd. But anyway, when you do that, 
you've getting whole array anyway --no point in that.


> # d(line_pix)  =   0  # black   
> #     returns: SyntaxError: can't assign to function call

sorry, that should be square brackets:

d[line_pix]  =   0  # black

I suggest making a small test array, and trying things out on the 
command line, to get the hang up it.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to