Types of mean

With Python code for an array-like a.