On Mar 8, 3:28 pm, [EMAIL PROTECTED] wrote: > Hi guys, > > One of my many project involves working with YUV-files, where I need > to reduce > the vertical resolution with a factor of two, i.e. remove every other > scan line. > Today I'm using two for-loops in the fashion shown below > > y = [] > for i in range(0, width*height, width*2): > for j in range(0,width): > y.append(Y[i+j])
There's nothing really wrong with your code. Maybe it's a little nicer written like this: y = [] for i in range(0, height, 2): y.extend(Y[i * width + j] for j in range(width)) -- Paul Hankin -- http://mail.python.org/mailman/listinfo/python-list