[Numpy-discussion] structured array with submember assign

2011-12-26 Thread Fabian Dill
Hello! I have a problem with a structured numpy array. I create is like this: tiles = numpy.zeros((header[width], header[height],3), dtype = numpy.uint8) and later on, assignments such as this: tiles[x, y,0] = 3 Now uint8 is not sufficient anymore, but only for the first of the 3 values. uint16

Re: [Numpy-discussion] structured array with submember assign

2011-12-26 Thread Derek Homeier
On 26.12.2011, at 7:37PM, Fabian Dill wrote: I have a problem with a structured numpy array. I create is like this: tiles = numpy.zeros((header[width], header[height],3), dtype = numpy.uint8) and later on, assignments such as this: tiles[x, y,0] = 3 Now uint8 is not sufficient anymore,

Re: [Numpy-discussion] structured array with submember assign

2011-12-26 Thread Fabian Dill
tiles = numpy.zeros((header[width], header[height]), dtype = [(0,u2),(1,|u1),(2,|u1)]) tiles[0][0,0] = 1 that does work now. however it's much slower in assigning and I cannot use integers for the first index. As it's now I might as well do: tiles = [numpy.zeros((header[width],