Hi, First here is some test I ran, where I think the last command shows a bug:
>>> a = N.arange(4); a.shape=2,2; a [[0 1] [2 3]] >>> aa = N.array((a,a,a)); aa [[[0 1] [2 3]] [[0 1] [2 3]] [[0 1] [2 3]]] >>> N.nonzero(a==0) ([0], [0]) >>> aa[N.nonzero(a==0)] = 5,5; aa [[[ 5 544434034] [ 2 3]] [[ 0 1] [ 2 3]] [[ 0 1] [ 2 3]]] What happend here ? The value 544434034 is different every time..... Background: I have a gray-scale 2D image (in this examples it's a 2x2 pixel image named 'a') I would like to show this image using grey-values EXCEPT I would like to show 0-values as blue. For use with pyOpenGL textures, I convert the image into an RGB image, in the example called 'aa', with shape 3,2,2. This is where I'm getting lost, and I tried assigning "something" (5,5) to aa "only at certain pixels".... Maybe someone can teach what the proper indexing-constuct, that I would need to do what I want. Did I find a bug ? Thanks, Sebastian Haase _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
