workaround numpy.mean() version without keepdims

This is a workaround for older numpys whose mean() function does not
have the keepdims keyword option.

Closes #26.
Merge pull request #28 from rjw57/keepdims-workaround

workaround numpy.mean() version without keepdims