Suppose you want to know the skewness of a list of numbers, and luckily enough you have Python close at hand. The
skew() function in the SciPy
stats library returns a single-element array instead of a floating-point number. Why, I have no idea, but at least the developers seem to know about it. Trying to get the value out by a sensible method like, say, indexing the array returns the error message “0-d arrays can’t be indexed.” To get the value itself, subtract 0:
result = scipy.stats.skew(list_of_values) - 0
Just one more way life has found to make itself interesting.