Q:

Sum then average values in a string of strings using Python

If I am given an json.dumps( output that gives a response as the following when focusing on a particular aspect of the response:
[["player1-game1", 2,2,4,5],["player1-game2",6,8,8,9]]

I would like to have it output the average of player one given 2 or infinite number of games played. 
What code must I use to get the average of those values in that string:
I would like it to print out the average of elements in [1], [2],... but not in [0] since it's a string.
How might I do this using Python 2.7; I tried using a combination of for loops even trying to set some value to an array in case I had thousands of players or stats.
The output I am hoping to get is:
[player-1, 4,5,6,7]

So [1,...] is the average of ["player-1",(2+6)/2,(8+2)/2,(4+8)/2,(9+5)/2]
Sorry I should have clarified.

A:

One approach would be to slice each list so that the first element is always treated separately and the rest of the elements as another list. Once you do that, you can easily extract it's average. E.g., using list comprehension:
orig =  [["player1-game1", 2,2,4,5], ["player1-game2",6,8,8,9]]
result = [ [x[0], float(sum(x[1:]))/len(x[1:])] for x in orig]

