I have a list that looks like this, but much, much longer (1,000,000+ tuples):
[(1, (226, 242, 195)), (1, (218, 236, 188)), (1, (219, 235, 188)), (1, (220, 236, 187)), (1, (217, 235, 187)), (1, (216, 232, 185)), (1, (216, 234, 184))]
I want to find the average of each value in the nested tuple and move those into a new list, like this:
[[1, [avg of first values, avg of second values, avg of third values]]]
If possible, I also would want to get rid of the leading 1, and simplify the list to
[avg of first values, avg of second values, avg of third values]
I've looked through all similar questions, but none seem to have the exact answer I'm looking for.
The most common error is
TypeError: unsupported operand type(s) for +: 'int' and 'tuple'