* Terry Carroll <[EMAIL PROTECTED]> [070426 07:14]:
> I have a list (of arbitrary length) of lists, each sublist having a fixed
> number N of items, all integers.
>
> I would like to produce a list of N items, each item of which is an
> integer which is the average of the elements in the same pos
On Thu, 26 Apr 2007, John Fouhy wrote:
> So, here is your one-line solution:
>
> >>> [sum(x)/len(x) for x in zip(*orig)]
> [30, 20, 50]
Beautiful. Thanks.
I wasn't looking for a one-liner, exactly, but just something that was
more straightforward and pythonic than what I was doing. But I fin
On 26/04/07, Terry Carroll <[EMAIL PROTECTED]> wrote:
> I have a list (of arbitrary length) of lists, each sublist having a fixed
> number N of items, all integers.
>
> I would like to produce a list of N items, each item of which is an
> integer which is the average of the elements in the same pos
I have a list (of arbitrary length) of lists, each sublist having a fixed
number N of items, all integers.
I would like to produce a list of N items, each item of which is an
integer which is the average of the elements in the same position of each
of the sublists of the original list.
I realiz