python - How to count and take averages on a tuple with Paired values
Question: I am new to python. Can you please help me with this? I have a tuple lets say
`(100, (10.0, 20.0, 30.0))`. I need to write a function which will take this
as an input and return `(100, (3, 20.0))` where `3` is the value count and
`20` is the value of average.


Answer: Have you tried something like this with numpy:

    
    
    import numpy
    def myfunction(mytuple):
        myresult=(mytuple[0],(len(mytuple[1]),numpy.mean(mytuple[1])))
        return myresult
    

