I'm trying to get the average of a list that has the following format:
[["195", "106", "100", "95"]]
.
Now sum(list1)
does not work (used for sum(list1)/len(list1)
(while len(list1)
works fine):
TypeError: unsupported operand type(s) for +: 'int' and 'list'
If the list were like this [195,106,100,95]
it would work. The same goes wrong if I use numpy.mean(list1)
. Is there something I can add so this will work? Or maybe a way for me to quickly convert the list format?